Optionally install Azure Bicep as part of azure-cli feature #305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When users run the
az bicep
command for the first time, Azure CLI looks for the Bicep binary in$HOME/.azure/bin
and if is not found, it will auto-install Bicep. This is a convenience feature of Azure CLI; however, it incorrectly installs Bicep onarm64
OS architectures.Here is an example of an error a user will encounter when running
az bicep
commands in a devcontainer hosted on M1 Macs:The error is due to OS architecture mismatch between the container
arm64
and the Bicep binaryamd64
that was auto-installed by Azure CLI.The long term fix for the Azure CLI to properly download the correct Bicep binary based on OS architecture. However, this may have a longer turnaround time.
The short term fix is in this PR which gives the user an option to install the Azure Bicep as part of the
azure-cli
feature. The install script will manually install Bicep based on OS architecture and create a symlink so thatbicep
is accessible as both a stand-alone executable and as part ofaz
.This will immediately unblock users who wish to use Bicep on arm64 based devcontainers and will submit an issue in the azure-cli repo to address the underlying root cause.