Skip to content
Merged
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
2 changes: 1 addition & 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.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.",
Expand Down
5 changes: 4 additions & 1 deletion src/azure-cli/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
Expand Down Expand Up @@ -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"
Expand Down
13 changes: 13 additions & 0 deletions test/azure-cli/install_fallback_pip_ubuntu_plucky.sh
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions test/azure-cli/install_in_ubuntu_resolute.sh
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions test/azure-cli/scenarios.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -102,5 +110,14 @@
"moby": false
}
}
},
"install_in_ubuntu_resolute": {
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"user": "vscode",
"features": {
"azure-cli": {
"version": "latest"
}
}
}
}
Loading