Skip to content

Azure CLI

Azure CLI is required for managing Azure resources from the command line.

Access rights

This and any deployment require a functionnal Azure account.
Please verify that you have access to Azure ressources here: https://portal.azure.com

Install Azure CLI on Debian

Install using the official Microsoft repository:

Install Azure CLI
cd ~/Tooling

# Install dependencies
sudo apt update
sudo apt install -y ca-certificates curl apt-transport-https lsb-release gnupg

# Add Microsoft signing key
sudo mkdir -p /etc/apt/keyrings
curl -sL https://packages.microsoft.com/keys/microsoft.asc | \
  gpg --dearmor | \
  sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg

# Add Azure CLI repository
AZ_DIST=bookworm
echo "Types: deb
URIs: https://packages.microsoft.com/repos/azure-cli/
Suites: ${AZ_DIST}
Components: main
Architectures: $(dpkg --print-architecture)
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources

sudo apt update
sudo apt install -y azure-cli

Verify the installation:

Check the Azure CLI version
az --version

Add Azure CLI to ToolingBins

Azure CLI is installed system-wide, but you can add a symlink for convenience:

Symlink az
cd ~/ToolingBins
ln -s /usr/bin/az az

Update Azure CLI

To update Azure CLI, run:

Update Azure CLI
sudo apt-get update
sudo apt-get install --only-upgrade -y azure-cli

az upgrade

References

Previous