diff options
Diffstat (limited to 'src/azure-cli')
-rw-r--r-- | src/azure-cli/devcontainer-feature.json | 19 | ||||
-rwxr-xr-x | src/azure-cli/install.sh | 12 |
2 files changed, 24 insertions, 7 deletions
diff --git a/src/azure-cli/devcontainer-feature.json b/src/azure-cli/devcontainer-feature.json index 12a4092..012e287 100644 --- a/src/azure-cli/devcontainer-feature.json +++ b/src/azure-cli/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "azure-cli", - "version": "1.0.5", + "version": "1.0.6", "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.", @@ -12,16 +12,21 @@ ], "default": "latest", "description": "Select or enter an Azure CLI version. (Available versions may vary by Linux distribution.)" + }, + "extensions": { + "type": "string", + "default": "", + "description": "Optional comma separated list of Azure CLI extensions to install in profile." } }, "customizations": { - "vscode": { - "extensions": [ - "ms-vscode.azurecli" - ] - } + "vscode": { + "extensions": [ + "ms-vscode.azurecli" + ] + } }, "installsAfter": [ "ghcr.io/devcontainers/features/common-utils" ] -} +}
\ No newline at end of file diff --git a/src/azure-cli/install.sh b/src/azure-cli/install.sh index de5d65d..99b4af5 100755 --- a/src/azure-cli/install.sh +++ b/src/azure-cli/install.sh @@ -13,6 +13,7 @@ set -e rm -rf /var/lib/apt/lists/* AZ_VERSION=${VERSION:-"latest"} +AZ_EXTENSIONS=${EXTENSIONS} MICROSOFT_GPG_KEYS_URI="https://packages.microsoft.com/keys/microsoft.asc" AZCLI_ARCHIVE_ARCHITECTURES="amd64" @@ -185,6 +186,17 @@ if [ "${use_pip}" = "true" ]; then fi fi +# If Azure CLI extensions are requested, loop through and install +if [ ${#AZ_EXTENSIONS[@]} -gt 0 ]; then + echo "Installing Azure CLI extensions: ${AZ_EXTENSIONS}" + extensions=(`echo ${AZ_EXTENSIONS} | tr ',' ' '`) + for i in "${extensions[@]}" + do + echo "Installing ${i}" + su ${_REMOTE_USER} -c "az extension add --name ${i} -y" || continue + done +fi + # Clean up rm -rf /var/lib/apt/lists/* |