-
Notifications
You must be signed in to change notification settings - Fork 754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module Path Substitution #12809
Comments
Yeah, this is kind of a pain point. As for allowing parameters in the module definition I guess the problem is not being able to restore the module and as such not providing intellisense/parameter validation, etc. The registry part can be "fake-parametrized" by using aliases in the bicepconfig.json file, but since you can't have multiple bicepconfig files in the same directory that has limitations as well. (I haven't experimented building a folder hierarchy with config files.) I currently work around the registry part by using a placeholder value like |
@ahelland and @JFolberth One of our goals with Bicep is to always ensure that we provide accurate completions and validation even when dealing with modules sourced from an external registry. Completely generic parameterization of the module sources makes providing that rather difficult. I'm wondering if there is a way to simplify the problem and still provide sufficient completion and validation. Could answer the following questions about this scenario?
Let's say you configured your registry as follows and "registry": "${registry}.azurecr.io"
|
Here are my initial thoughts @majastrz :
|
@ahelland Makes sense. I've got some additional questions:
|
|
Posting to keep the thread alive as I mostly agree with @ahelland responses. I think at the end of the day the substitution needs the ability to occur at CLI level. This would ensure the ability to automate the deployments w/ the appropriate configurations. For publishing the modules I feel this is out of scope of the question. Modules being published would adhere to there own lifecycle and really don't want to open this up outside of the ask of how to accommodate leveraging a single bicep file for deployment across various environments which may contain different registry values. |
I agree with the point about publish since I'm wondering if this could be a good starting point:
Thoughts? |
Sounds like a plan @majastrz We're talking about exposing the registry specifically as a command line switch like Definitely need a working default for the Intellisense. Out of curiosity - what takes so long when doing the
The easiest script-wise is to just loop through the modules sub-directories and attempt all of them. Either they give the warning the module exists or a new version is published. Works fine, but adds time to the pipeline. Oh well, not a technical problem per se I guess :) |
Yes, this would be specific to the registry sections, but we could consider expanding it in the future. For the issue of publish taking a long time, can you open a separate issue? |
I took off the labels so the bot doesn't close this. |
Is your feature request related to a problem? Please describe.
Yes. When hosting bicep modules in a registry would like to either a.) substitute the registry URL per environment or b.) substitute the tag in the module location for the specific environment/version.
This is an issue with teams who may have different module definitions for dev/test/prod or have the desire to run things like a beta module in their dev environment. Currently the module reference requires a path that cannot be interpopulated. Other IaC providers get around this with the
source
property in the module block.Describe the solution you'd like
A clear and concise description of what you want to happen.
Something like:
module appService '${parameters.registryURL}:${parameters.registryTag}'
The text was updated successfully, but these errors were encountered: