mirror of
https://github.com/actions/runner-images.git
synced 2025-12-12 20:26:49 +00:00
31 lines
1.2 KiB
Bash
31 lines
1.2 KiB
Bash
#!/bin/bash -e
|
|
################################################################################
|
|
## File: install-azure-cli.sh
|
|
## Desc: Install Azure CLI (az)
|
|
################################################################################
|
|
|
|
# Source the helpers for use with the script
|
|
source $HELPER_SCRIPTS/os.sh
|
|
|
|
# Install Azure CLI (instructions taken from https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
|
|
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
|
|
|
|
echo "azure-cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-linux?pivots=apt" >> $HELPER_SCRIPTS/apt-sources.txt
|
|
|
|
rm -f /etc/apt/sources.list.d/azure-cli.list
|
|
rm -f /etc/apt/sources.list.d/azure-cli.list.save
|
|
|
|
invoke_tests "CLI.Tools" "Azure CLI"
|