diff --git a/src/azure-cli/devcontainer-feature.json b/src/azure-cli/devcontainer-feature.json index a634818b6..7280ad2ad 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.9", + "version": "1.3.0", "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.", diff --git a/src/azure-cli/install.sh b/src/azure-cli/install.sh index bc5744ce2..425deafe9 100755 --- a/src/azure-cli/install.sh +++ b/src/azure-cli/install.sh @@ -19,7 +19,7 @@ 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" -AZCLI_ARCHIVE_VERSION_CODENAMES="stretch bookworm buster bullseye bionic focal jammy noble trixie" +AZCLI_ARCHIVE_VERSION_CODENAMES="stretch bookworm buster bullseye bionic focal jammy noble trixie resolute" if [ "$(id -u)" -ne 0 ]; then echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' @@ -200,6 +200,9 @@ CACHED_AZURE_VERSION="${AZ_VERSION}" # In case we need to fallback to pip and th if [ "${INSTALL_USING_PYTHON}" != "true" ]; then if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then install_using_apt || use_pip="true" + else + echo "(*) Codename '${VERSION_CODENAME}' or architecture '${architecture}' not in apt archive list, falling back to pip installation." + use_pip="true" fi else use_pip="true" diff --git a/test/azure-cli/install_fallback_pip_ubuntu_plucky.sh b/test/azure-cli/install_fallback_pip_ubuntu_plucky.sh new file mode 100644 index 000000000..f6fffd02b --- /dev/null +++ b/test/azure-cli/install_fallback_pip_ubuntu_plucky.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Import test library for `check` command +source dev-container-features-test-lib + +# Ubuntu plucky (25.04) is NOT in the apt archive codename allowlist, +# so this test validates the pip fallback path. +check "version" az --version + +# Report result +reportResults diff --git a/test/azure-cli/install_in_ubuntu_resolute.sh b/test/azure-cli/install_in_ubuntu_resolute.sh new file mode 100644 index 000000000..eff30a25c --- /dev/null +++ b/test/azure-cli/install_in_ubuntu_resolute.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -e + +# Import test library for `check` command +source dev-container-features-test-lib + +# Check to make sure the user is vscode +check "user is vscode" whoami | grep vscode + +check "version" az --version + +# Report result +reportResults diff --git a/test/azure-cli/scenarios.json b/test/azure-cli/scenarios.json index 1ba173de9..29fb4f935 100644 --- a/test/azure-cli/scenarios.json +++ b/test/azure-cli/scenarios.json @@ -1,4 +1,12 @@ { + "install_fallback_pip_ubuntu_plucky": { + "image": "ubuntu:plucky", + "features": { + "azure-cli": { + "version": "latest" + } + } + }, "install_extensions_trixie": { "image": "mcr.microsoft.com/devcontainers/base:trixie", "user": "vscode", @@ -102,5 +110,14 @@ "moby": false } } + }, + "install_in_ubuntu_resolute": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "user": "vscode", + "features": { + "azure-cli": { + "version": "latest" + } + } } } \ No newline at end of file