Variable paths for modules #3896
-
|
Hi, I have a Bicep file myApp.bicep, which includes modules for various resources, such as keyVault.bicep. Right now, those are all in the same directory, so this works: However, we want to separate out our base resource templates from composite and deployment templates, so in the future, these won't be in the same directory, or even in the same repo. I wanted to be able to pass a parameter for the template path, so that the module statement can find the modules. I was hoping to do something like this: or even Unfortunately, this doesn't work, and the bicep compiler explodes when I try to do this. Is it possible to have anything other than a hardcoded path for a module declaration? Is there any plan to support this in the future? If not, I'm guessing I would have to copy the templates from the base template repo into a known location as part of my pipeline before executing this bicep deployment, but I'd love to hear if there are better ideas. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Adding the related error: |
Beta Was this translation helpful? Give feedback.
-
|
An option that may work better for you will be the upcoming Module registry, #2128, This would let you call your modules from a public or private container registry. Today I can tell you that I use hardcoded modules path with each deployment. choosing a standard location in your repos may make it easier to control the expected path till the Module registry option becomes available. |
Beta Was this translation helpful? Give feedback.
An option that may work better for you will be the upcoming Module registry, #2128, This would let you call your modules from a public or private container registry.
Today I can tell you that I use hardcoded modules path with each deployment.
Repo Root
-> Templates
-> IaC
-> modules
-> main.bicep
choosing a standard location in your repos may make it easier to control the expected path till the Module registry option becomes available.