AZ-CLI

The Azure CLI is a cross-platform command-line tool that can be installed locally on Linux computers. You can use the Azure CLI on Linux to connect to Azure and execute administrative commands.

Install on Fedora

sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo dnf install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm
sudo dnf install -y https://packages.microsoft.com/config/rhel/8/packages-microsoft-prod.rpm
sudo dnf install azure-cli

Proxy settings if needed:

# No auth
export HTTP_PROXY=http://[proxy]:[port]
export HTTPS_PROXY=https://[proxy]:[port]

# Basic auth
export HTTP_PROXY=http://[username]:[password]@[proxy]:[port]
export HTTPS_PROXY=https://[username]:[password]@[proxy]:[port]

Docker/Podman

docker run -it mcr.microsoft.com/azure-cli

If you want to pick up the SSH keys from your user environment, use -v ${HOME}/.ssh:/root/.ssh to mount your SSH keys in the environment.

docker run -it -v ${HOME}/.ssh:/root/.ssh mcr.microsoft.com/azure-cli

Windows:

winget install -e --id Microsoft.AzureCLI

Great source for examples:

https://github.com/Azure-Samples/azure-cli-samples/blob/master/virtual-machine/copy-snapshots-to-storage-account/copy-snapshots-to-storage-account.sh

Last updated