Skip to content
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

[azure-cli]: add bicepVersion for use with installBicep #1227

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/azure-cli/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "azure-cli",
"version": "1.2.5",
"version": "1.2.6",
"name": "Azure CLI",
"documentationURL": "https://github.com/devcontainers/features/tree/main/src/azure-cli",
"description": "Installs the Azure CLI along with needed dependencies. Useful for base Dockerfiles that often are missing required install dependencies like gpg.",
Expand All @@ -23,6 +23,14 @@
"description": "Optionally install Azure Bicep",
"default": false
},
"bicepVersion": {
"type": "string",
"proposals": [
"latest"
],
"default": "latest",
"description": "Select or enter a Bicep version. ('latest' or a specic version such as 'v0.31.92')"
},
"installUsingPython": {
"type": "boolean",
"description": "Install Azure CLI using Python instead of pipx",
Expand Down
11 changes: 9 additions & 2 deletions src/azure-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ rm -rf /var/lib/apt/lists/*
AZ_VERSION=${VERSION:-"latest"}
AZ_EXTENSIONS=${EXTENSIONS}
AZ_INSTALLBICEP=${INSTALLBICEP:-false}
AZ_BICEPVERSION=${BICEPVERSION:-latest}
INSTALL_USING_PYTHON=${INSTALLUSINGPYTHON:-false}
MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc"
AZCLI_ARCHIVE_ARCHITECTURES="amd64 arm64"
Expand Down Expand Up @@ -229,10 +230,16 @@ if [ "${AZ_INSTALLBICEP}" = "true" ]; then
# The `az bicep install --target-platform` could be a solution; however, linux-arm64 is not an allowed value for this argument yet
# Manually installing Bicep and moving to the appropriate directory where az expects it to be

if [ "${AZ_BICEPVERSION}" = "latest" ]; then
bicep_download_path="https://github.com/Azure/bicep/releases/latest/download"
else
bicep_download_path="https://github.com/Azure/bicep/releases/download/${AZ_BICEPVERSION}"
fi

if [ "${architecture}" = "arm64" ]; then
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-arm64
curl -Lo bicep ${bicep_download_path}/bicep-linux-arm64
else
curl -Lo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64
curl -Lo bicep ${bicep_download_path}/bicep-linux-x64
fi

chmod +x ./bicep
Expand Down