Skip to content

[Reference feedback]: az bicep install --version {new_version} ignores the version request when bicep.use_binary_from_path=true #32098

@TomasMalecek

Description

@TomasMalecek

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

https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-autogen/Latest-version/latest/bicep.yml

Author

@mikefrobbins

Document Id

701cd406-cabb-5551-0914-d716da3322a5

Metadata

Metadata

Assignees

No one assigned

    Labels

    Auto-AssignAuto assign by botAzure Deploymentsaz deployment/bicep/stack/deployment-scripts/ts/group exportConfigureaz configure/configService AttentionThis issue is responsible by Azure service team.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-triageThis is a new issue that needs to be triaged to the appropriate team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions