Skip to content

azure-cli: silent no-op on unknown Ubuntu codenames (e.g. resolute / 26.04) #1667

@kleinc80

Description

@kleinc80

Summary

The azure-cli feature silently does nothing — no error, claims Done! — when run on an Ubuntu release whose codename isn't in the feature's hardcoded allowlist. On Ubuntu 26.04 LTS (codename resolute, the current mcr.microsoft.com/devcontainers/base:ubuntu tag as of May 2026), this means containers come up apparently fine but without the Azure CLI installed.

Reproduce

{
  "image": "mcr.microsoft.com/devcontainers/base:ubuntu",
  "features": {
    "ghcr.io/devcontainers/features/azure-cli:1": {}
  }
}

Build output for the feature step:

(*) Installing Azure CLI...
Installing Azure CLI extensions:
Done!
DONE 0.4s

After build:

$ which az; find / -name 'az' -type f 2>/dev/null
$

No binary present anywhere.

Root cause

In src/azure-cli/install.sh (current main):

# line 22
AZCLI_ARCHIVE_VERSION_CODENAMES="stretch bookworm buster bullseye bionic focal jammy noble trixie"
# lines 200–206
if [ "${INSTALL_USING_PYTHON}" != "true" ]; then
    if [[ "${AZCLI_ARCHIVE_ARCHITECTURES}" = *"${architecture}"* ]] \
    && [[ "${AZCLI_ARCHIVE_VERSION_CODENAMES}" = *"${VERSION_CODENAME}"* ]]; then
        install_using_apt || use_pip="true"
    fi
    # ← no `else`: when the codename check fails, nothing runs and use_pip stays unset
fi

if [ "${use_pip}" = "true" ]; then
    install_using_pip_strategy
fi

When VERSION_CODENAME=resolute (or any codename not in the allowlist), neither branch installs anything and the script falls through to the extensions loop and prints Done!. No error, exit 0.

Suggested fixes (any one would address it)

  • Add resolute (and future codenames) to AZCLI_ARCHIVE_VERSION_CODENAMES.
  • Make a codename-allowlist miss a visible error (echo "Unsupported codename: ${VERSION_CODENAME}" + exit 1).
  • Fall back to the pip strategy when the apt path is unavailable, by setting use_pip="true" in an else branch of the inner if.

Related

Workaround

Install Azure CLI in postCreateCommand via pipx install azure-cli instead of using this feature.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions