publish bicep modules to ACR with azure devops #5089
-
Hi all, with the new private registry functionality I have a question about updating modules in the registry. Let's say you have github repo with some modules witch you publish to an Azure container registry. You can do this manually with the bicep publish command, but if you want to automate this with an release pipeline in devops it becomes somewhat complicated. How can you automaticly update the tag if a module file has changed? I have now created a script witch performs the Az publish commands. But you have to manually upgrade the tag in the script. Any thoughts or help on this topic would be really helpfull. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
You can use environment variables or script arguments to make the script dynamic. Then you will need a way of generating a version and providing that to the script. You might want to look at something like NerdBank. |
Beta Was this translation helpful? Give feedback.
-
@JeroenvdBurg We are documenting our modules in a readme stored along with our modules. When updating the modules, we also need to update the readme to reflect the changes. When doing that, we document the version bump in the readme too. On top of that, our pipeline evaluates, wether the readme version has been bumped or not. If the readme has been bumped, the pipeline uploads a new version, with the version number from the readme, to the registry. Both outcomes (bump or not) are recorded in the pipeline. Prior to this, we kept a variable with a version number within the module, but the current approach gives us a cleaner module and endures, that we update the documentation. |
Beta Was this translation helpful? Give feedback.
-
Built my own scripts to do this.
Also created a script that will automatically update all imports/uses to the latest version available in the ACR. |
Beta Was this translation helpful? Give feedback.
@JeroenvdBurg We are documenting our modules in a readme stored along with our modules. When updating the modules, we also need to update the readme to reflect the changes. When doing that, we document the version bump in the readme too.
On top of that, our pipeline evaluates, wether the readme version has been bumped or not. If the readme has been bumped, the pipeline uploads a new version, with the version number from the readme, to the registry. Both outcomes (bump or not) are recorded in the pipeline.
Prior to this, we kept a variable with a version number within the module, but the current approach gives us a cleaner module and endures, that we update the documentation.