Open skyaddict opened 3 years ago
This has a lot of use cases as parameter files can become very clunky after a few hundred lines. Our App Gateway parameters are very unwieldy so I am moving the config to Bicep and storing each application configuration in it's own json file. Then I am loading that file in the main.bicep and passing the appropriate config to the required module. It would be extremely helpful to not have 20 load statements and to continuing adding them with every new config
This would be really useful in some scenarios, although one would need to be careful to not exceed the ARM deployment engine size limit when loading bunch of files from directory.
Scenarios:
+1 for this as it's a scenario we are also finding.
We are utilizing APIM with several different APIs and Endpoints. We currently have a Swagger + Policy file for each API, and this is loaded by using the file load capability that is now in Bicep. However, when new APIs are added, we would like to rely on folder conventions to simply load in the API as it's added, essentially removing the need for someone to edit the main bicep file each time.
I hit the same problem while generating AppInsights alerts using json config files. My workaround is to generate a .bicep file before the compilation step that references all the config files in the alerts directory.
Example: https://gist.github.com/nayanshah/7c86cfe6c9882c9e8133cee6ce17c9bb
With the creation of https://github.com/Azure/bicep/issues/471 there will be the ability to load content from a file. The next logical step would be to allow for each file in a folder. The file object returned should include FullName, BaseName, parent dir. Wildcarding would also be helpful. .xls, .liquid, etc.
Potentially something like Get_ChildItem from PowerShell.
foreach ($file in Get-ChildItem '$(Pipeline.Workspace)/Infrastructure/Schemas')
Example: I create an integration account and then need to load the Maps and schemas into this integration account. I could see something like
Today an object with each file path and name listed does the trick, however having this be more dynamic would be excellent. and avoid missing things when they get added.