diff --git a/src/azure-cli/devcontainer-feature.json b/src/azure-cli/devcontainer-feature.json index e73d2295c..a95c33dab 100644 --- a/src/azure-cli/devcontainer-feature.json +++ b/src/azure-cli/devcontainer-feature.json @@ -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.", @@ -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", diff --git a/src/azure-cli/install.sh b/src/azure-cli/install.sh index 2b52ca158..16b37c94e 100755 --- a/src/azure-cli/install.sh +++ b/src/azure-cli/install.sh @@ -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" @@ -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 [ "${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/${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