-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Type of issue
Missing information
Reference command name
az bicep install
Feedback
az bicep install --version {new_version} ignores the version request when bicep.use_binary_from_path=true. The same holds when bicep.use_binary_from_path=if_found_in_ci, we are running in CI and the Bicep CLI binary is found in PATH. This is actually the case I ran into.
I am trying to enforce a specific Bicep version in my pipeline in Azure DevOps Server while I have no power over the software pre-installed on the agents available in our company. Currently, Azure CLI v2.74.0 is installed on the agents, with default configuration (i.e., bicep.use_binary_from_path=if_found_in_ci). Also, Bicep CLI v0.33.93 is installed but my template needs Bicep v0.37.4. My pipeline does az bicep install --version v0.37.4 before building the template but the build uses the pre-installed v0.33.93 anyway and warns about too new API versions being used (which does not happen when I build the template locally using v0.37.4):
Warning BCP081: Resource type "Microsoft.Storage/storageAccounts@2025-01-01" does not have types available. Bicep is unable to validate resource properties prior to deployment, but this will not block the resource from being deployed. [https://aka.ms/bicep/core-diagnostics#BCP081]
To me, this is unexpected and it is a breaking change released in Azure CLI v2.71.0, caused by #31041. Before that, install with a specific version ensured that the required version is installed. My pipeline used to specify Bicep v0.34.44 and Azure CLI older than v2.71.0 used to be installed on the agents. Regardless of the pre-installed Bicep version, my pipeline used v0.34.44 as designed. Then, the admins upgraded Azure CLI on the agents, which caused my pipeline to start using the older, pre-installed Bicep v0.33.93. The difference in the versions was not large enough to trigger any issues in my template. Today, I updated API versions in my template and Bicep version specified in the pipeline and the warnings like above appeared.
I am not sure if this is a bug, so I am posting it as a question/request for reference documentation improvement. No matter how I dislike the new behavior, I can accept is as by design -- however, in that case, it should be documented better to explain that this is actually the desired behavior and that my use case requires az config set bicep.use_binary_from_path=false. I tracked down the source of the change in behavior (the PR linked above) so I believe debug logs are not needed.
Overall, the az bicep docs are too vague about the meaning of the config options and the other option's default is not documented at all. However, that is only tangentially related, so feel free to ignore this last paragraph.
Page URL
https://learn.microsoft.com/en-us/cli/azure/bicep?view=azure-cli-latest
Content source URL
Author
Document Id
701cd406-cabb-5551-0914-d716da3322a5