diff --git a/src/azure-cli/devcontainer-feature.json b/src/azure-cli/devcontainer-feature.json index 3bc905f47..a634818b6 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.8", + "version": "1.2.9", "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 171c24510..9cc8edef7 100755 --- a/src/azure-cli/install.sh +++ b/src/azure-cli/install.sh @@ -98,7 +98,11 @@ install_using_apt() { # Import key safely (new 'signed-by' method rather than deprecated apt-key approach) and install curl -sSL ${MICROSOFT_GPG_KEYS_URI} | gpg --dearmor > /usr/share/keyrings/microsoft-archive-keyring.gpg echo "deb [arch=${architecture} signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/azure-cli/ ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/azure-cli.list - apt-get update + + if ! (apt-get update); then + echo "(!) Failed to update apt cache, removing repository file" + rm -f /etc/apt/sources.list.d/azure-cli.list + fi if [ "${AZ_VERSION}" = "latest" ] || [ "${AZ_VERSION}" = "lts" ] || [ "${AZ_VERSION}" = "stable" ]; then # Empty, meaning grab the "latest" in the apt repo @@ -135,7 +139,7 @@ install_using_pip_strategy() { install_with_pipx() { echo "(*) Attempting to install globally with pipx..." - local ver="$1" + local ver="$1" export local diff --git a/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh new file mode 100644 index 000000000..3f5e6f540 --- /dev/null +++ b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +# Import test library for `check` command +source dev-container-features-test-lib + +check "version" az --version + +check "docker installed" bash -c "type docker" + +# Report result +reportResults \ No newline at end of file diff --git a/test/azure-cli/scenarios.json b/test/azure-cli/scenarios.json index c3a205e68..4c12034b5 100644 --- a/test/azure-cli/scenarios.json +++ b/test/azure-cli/scenarios.json @@ -8,7 +8,7 @@ "extensions": "aks-preview,amg,containerapp" } } - }, + }, "install_extensions": { "image": "mcr.microsoft.com/devcontainers/base:jammy", "user": "vscode", @@ -39,7 +39,7 @@ } } }, - "install_bicep_trixie": { + "install_bicep_trixie": { "image": "mcr.microsoft.com/devcontainers/base:trixie", "user": "vscode", "features": { @@ -68,7 +68,7 @@ "installUsingPython": true } } - }, + }, "install_with_python_3_12_bookworm": { "image": "mcr.microsoft.com/devcontainers/python:1-3.12-bookworm", "user": "vscode", @@ -87,5 +87,20 @@ "installUsingPython": "true" } } + }, + "install_azcli_dotnet_dockerindocker_trixie": { + "image": "mcr.microsoft.com/devcontainers/dotnet:dev-10.0-preview-trixie", + "user": "vscode", + "features": { + "azure-cli": { + "version": "latest" + }, + "dotnet": { + "aspNetCoreRuntimeVersions": "8.0" + }, + "docker-in-docker": { + "moby": false + } + } } } \ No newline at end of file