Configurations as bicep code #5546
-
Hi all, is it just me? But I don’t like the shared variable file pattern: https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/patterns-shared-variable-file would it make more sense to allow to load a bicep file that has only variables defined into the context of my bicep file so it can be used? mit would make it much easier to convert from a local variable to a centralized file. VSCode could even offer that as an action, like Eclipse does for Java. Is it an option a construct like that makes it to the roadmap? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There are several points to cover here, that you have made.
There is an open issue to be able to have a Bicep native language parameter file, it might be worth noting on that issue that loadtextcontent() should also be under consideration for that issue, to allow bicep data format. In saying that json is a common data format that is used by ARM, so often it's very useful to integrate or interoperate via json when importing data. The json format serializes to a string very well, which is makes it practical for data exchange.
There are some current issues relating to how the json is handled within Bicep
I would recommend to review the above or some others of these items: Some common things that loadtextcontext() is useful for is:
There are other ways to import Shared Data, e.g. a data file per Region or Per Tenant or Subscription, however since you cannot use a variable or parameter to define the path to the loadtextcontent() file path, you have to pass them in via Parameters.
Can you share some types of information that you would like to place in your Global shared variable config file? Some specific examples would be useful to direct the conversation. At the moment there is the ability to have bicepconfig.json however it's for configuration settings for Bicep.exe not for configurations or configurationdata. |
Beta Was this translation helpful? Give feedback.
There are several points to cover here, that you have made.
There is an open issue to be able to have a Bicep native language parameter file, it might be worth noting on that issue that loadtextcontent() should also be under consideration for that issue, to allow bicep data format.
In saying that json is a common data format that is used by ARM, so often it's very useful to integrate or interoperate via json when importing data. The json format serializes to a string very well, which is makes it practical for data exchange.
There are some current issues relating to how the json is handled within Bicep
e.g.
I would r…