aboutsummaryrefslogtreecommitdiff
path: root/src/azure-cli/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/azure-cli/install.sh')
-rwxr-xr-xsrc/azure-cli/install.sh12
1 files changed, 12 insertions, 0 deletions
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/*