From 84d912803bc5389b17594b6e3c75ff98bac58c71 Mon Sep 17 00:00:00 2001 From: Mathiyarasy <157102811+Mathiyarasy@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:12:56 +0000 Subject: [PATCH 1/4] For trixie fix azure-cli installation --- src/azure-cli/install.sh | 8 ++++++-- test/azure-cli/install_azcli_dotnet.sh | 13 +++++++++++++ test/azure-cli/scenarios.json | 21 ++++++++++++++++++--- 3 files changed, 37 insertions(+), 5 deletions(-) create mode 100644 test/azure-cli/install_azcli_dotnet.sh 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.sh b/test/azure-cli/install_azcli_dotnet.sh new file mode 100644 index 000000000..15ea597a7 --- /dev/null +++ b/test/azure-cli/install_azcli_dotnet.sh @@ -0,0 +1,13 @@ +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 \ 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 From 4f35dbc136419037cda1f683693c98ee79915013 Mon Sep 17 00:00:00 2001 From: Mathiyarasy <157102811+Mathiyarasy@users.noreply.github.com> Date: Fri, 3 Oct 2025 13:38:11 +0000 Subject: [PATCH 2/4] rename file --- ...li_dotnet.sh => install_azcli_dotnet_dockerindocker_trixie.sh} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename test/azure-cli/{install_azcli_dotnet.sh => install_azcli_dotnet_dockerindocker_trixie.sh} (100%) diff --git a/test/azure-cli/install_azcli_dotnet.sh b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh similarity index 100% rename from test/azure-cli/install_azcli_dotnet.sh rename to test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh From 4c914919203fc36ba8bec8e0334623f62e2a3120 Mon Sep 17 00:00:00 2001 From: Mathiyarasy <157102811+Mathiyarasy@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:07:55 +0000 Subject: [PATCH 3/4] missing shabang line --- test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh index 15ea597a7..a5c07856e 100644 --- a/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh +++ b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh @@ -1,3 +1,5 @@ +#!/bin/bash + set -e # Import test library for `check` command From dcd0c88e29623fabf3c9fd26c42b4c0e2e6692e8 Mon Sep 17 00:00:00 2001 From: Mathiyarasy <157102811+Mathiyarasy@users.noreply.github.com> Date: Mon, 6 Oct 2025 06:02:48 +0000 Subject: [PATCH 4/4] update version --- src/azure-cli/devcontainer-feature.json | 2 +- test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) 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/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh index a5c07856e..3f5e6f540 100644 --- a/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh +++ b/test/azure-cli/install_azcli_dotnet_dockerindocker_trixie.sh @@ -5,11 +5,9 @@ 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 +check "docker installed" bash -c "type docker" # Report result reportResults \ No newline at end of file