Skip to content

Optionally install Azure Bicep as part of azure-cli feature #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 23, 2022

Conversation

pauldotyu
Copy link
Contributor

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 on arm64 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:

$ az bicep version

qemu-x86_64: Could not open '/lib64/ld-linux-x86-64.so.2': No such file or directory

The error is due to OS architecture mismatch between the container arm64 and the Bicep binary amd64 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 that bicep is accessible as both a stand-alone executable and as part of az.

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.

@pauldotyu pauldotyu requested a review from a team as a code owner November 23, 2022 18:19
Copy link
Member

@joshspicer joshspicer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Thank you for the detailed PR. Left a couple suggestions if you have the time.

@pauldotyu
Copy link
Contributor Author

This is awesome! Thank you for the detailed PR. Left a couple suggestions if you have the time.

Thanks! Some edits have been made based on your feedback. Let me know if I am missing anything else.

Copy link
Member

@joshspicer joshspicer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants