Automated Update of API versions in Bicep templates, reasonable? #10306
-
Hi Bicep Team I have a question about a Bicep related feature I have just discovered in Mend Renovate (tool for automated dependency updates, similar to Dependabot): I am asking because I am a bit concerned about the feature they have implemented there. Correct me if I am wrong but as far I am aware it is not very good practice to always update the API versions in existing Bicep (and ARM) templates only to have just the latest version referenced in the template. But that is exactly what the renovate tools it trying to achieve with that feature. Unfortunately I could also not find a clear statement in Bicep documentation what the best practices with the API versions in Bicep actually is or what is recommended. So is it still the idea to continue to use the same API version in a template/deployment until the deployment needs to be changed anyway and a feature of a new API version is really needed? Or has that also changed a bit since the ARM template days? Thx! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
Hi @J0F3 that document link you sent is accurate. The guidance is equal for Bicep as ARM json. In fact they removed to ability to have dynamic variables in Bicep by using a parameter. To encourage static api versions. adding the two paragraphs from the docs.
Also like you mentioned, if you need new features then consider updating the API version at that time. Test deploy to test new features and for any breaking changes. |
Beta Was this translation helpful? Give feedback.
-
As Bicep transpiles to ARM almost all of the best practices, like this one on
This I think is a case of where many orgs are much more likely to stick to a tried and tested progressional advancement strategy than just running on latest api version all the time for everything, but I could be wrong |
Beta Was this translation helpful? Give feedback.
-
While I understand the guidance it would be grate to have the option to use the latest version for an api. Something like
Would be great. I just wasted something like 3 hours because somewhere hidden I was using an old API. |
Beta Was this translation helpful? Give feedback.
Hi @J0F3 that document link you sent is accurate. The guidance is equal for Bicep as ARM json.
In fact they removed to ability to have dynamic variables in Bicep by using a parameter. To encourage static api versions.
adding the two paragraphs from the docs.
Set the apiVersion property to a hard-coded API version for the resource type. When creating a new template, we recommend you use the latest API version for a resource type. To determine available values, see template reference.
When your template works as expected, we recommend you continue using the same API version. By using the same API version, you don't have to worry about breaking changes that might be introduced in later v…