2020-10-07 13:49:40 +05:00
|
|
|
#!/bin/bash -e
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
2023-11-22 21:49:23 +01:00
|
|
|
## File: install-azure-cli.sh
|
|
|
|
|
## Desc: Install Azure CLI (az)
|
2019-12-13 09:48:00 -05:00
|
|
|
################################################################################
|
|
|
|
|
|
2024-05-16 12:23:51 +02:00
|
|
|
# Source the helpers for use with the script
|
|
|
|
|
source $HELPER_SCRIPTS/os.sh
|
|
|
|
|
|
2019-12-13 09:48:00 -05:00
|
|
|
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
2024-05-16 12:23:51 +02:00
|
|
|
if is_ubuntu24; then
|
|
|
|
|
apt-get install apt-transport-https
|
|
|
|
|
curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
|
|
|
|
|
gpg --dearmor | \
|
|
|
|
|
sudo tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null
|
|
|
|
|
AZ_DIST="jammy"
|
|
|
|
|
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_DIST main" | \
|
|
|
|
|
sudo tee /etc/apt/sources.list.d/azure-cli.list
|
|
|
|
|
sudo apt-get update
|
|
|
|
|
sudo apt-get install azure-cli
|
|
|
|
|
else
|
|
|
|
|
curl -fsSL https://aka.ms/InstallAzureCLIDeb | sudo bash
|
|
|
|
|
fi
|
|
|
|
|
|
2021-05-05 18:39:04 +05:00
|
|
|
echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt
|
2023-12-29 12:36:27 +01:00
|
|
|
|
2021-05-05 18:39:04 +05:00
|
|
|
rm -f /etc/apt/sources.list.d/azure-cli.list
|
|
|
|
|
rm -f /etc/apt/sources.list.d/azure-cli.list.save
|
2019-12-13 09:48:00 -05:00
|
|
|
|
2021-05-05 18:39:04 +05:00
|
|
|
invoke_tests "CLI.Tools" "Azure CLI"
|