bicep icon indicating copy to clipboard operation
bicep copied to clipboard

possibility to call module from registry with version stored in variable

Open maxinthecloud opened this issue 3 years ago • 11 comments

Is your feature request related to a problem? Please describe. Now it is not possible to call a module from registry with specified version in a variable

var version = '0.0.1'
module mod_webapp 'br/CoreModules:mod_webapp:${version}' = { 
  name: 'deployment-mod_webapp' 
...
}

Describe the solution you'd like I would like to store the module version in the variable or param.

maxinthecloud avatar Feb 08 '22 11:02 maxinthecloud

I thought we had another issue about this, but I can't find it. This is feasible with variables, but not with parameters, since parameter values are not known until deployment and that could change the module code that needs to be validated.

alex-frankel avatar Feb 08 '22 17:02 alex-frankel

Related: #413

alex-frankel avatar Mar 14 '22 18:03 alex-frankel

I also have a use case where the path to the ACR and the version of the Bicep module need to be defined as parameters that are leveraged by an Azure DevOps pipeline when deploying/updating infrastructure.

olorinhill avatar Sep 21 '22 11:09 olorinhill

Specifying the name of the ACR as a parameter would be indeed valuable as you wouldn't need to update every template when you migrate to another container registry.

jhueppauff avatar Jan 10 '23 09:01 jhueppauff

Specifying the name of the ACR as a parameter would be indeed valuable as you wouldn't need to update every template when you migrate to another container registry.

@jhueppauff - specifically for this case, we would recommend adding an alias to bicepconfig, and if you ever change the ACR URL, you would only need to change the value in bicepconfig: https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/bicep-config-modules#aliases-for-modules

alex-frankel avatar Jan 23 '23 23:01 alex-frankel

Any news about this feature request plz ? I still have "Error BCP092: String interpolation is not supported in file paths."

SadokLadhari avatar Mar 05 '23 12:03 SadokLadhari

Hi maxinthecloud, this issue has been marked as stale because it was labeled as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. Thanks for contributing to bicep! :smile: :mechanical_arm:

ghost avatar May 19 '23 04:05 ghost

could this please be reopened? I would really like this enhancement as we can tokenize our paths.

joeferreirapremera avatar May 26 '23 16:05 joeferreirapremera

Re-opening and renaming to cover variables specifically, since that's much easier than params.

alex-frankel avatar May 26 '23 19:05 alex-frankel

We are a large team of developers in my company that would appreciate this feature immensely as we address different versions of bicep modules hosted in an ACR. Pretty please, save us :)

Htorne avatar Aug 17 '23 12:08 Htorne

This would be very useful. I have a UAT and a Production container registry for modules, and being able to set the path would be useful

martinjosephogorman avatar May 10 '24 08:05 martinjosephogorman