Install the new version of the Azure CLI today! We've improved and updated it to provide a great native command-line experience for managing Azure resources. It can be used on macOS, Linux, and Windows. For information about the latest release, see the release notes.
Note
If you need the previous version of the Azure CLI, here's how to install Azure CLI 1.0.
macOS
Warning
The Homebrew formula for the Azure CLI, azure-cli, is currently out of date and will install a previous version.
Install Azure CLI 2.0 with one
curlcommand.curl -L https://aka.ms/InstallAzureCli | bashYou may have to restart your command shell for some changes to take effect.
exec -l $SHELLRun the CLI from the command prompt with the
azcommand.
Note
When you install with InstallAzureCli, az component update isn't supported.
To update to the latest CLI, run curl -L https://aka.ms/InstallAzureCli | bash again.
To uninstall, see the manual uninstall instructions.
Windows
You can install Azure CLI 2.0 with the MSI and use it in the Windows command-line, or you can install the CLI with apt-get on Bash on Ubuntu on Windows.
MSI for the Windows command-line
To install the CLI on Windows and use it in the Windows command-line, download and run the msi.
Note
When you install with the msi, az component isn't supported.
To update to the latest CLI, run the msi again.
To uninstall the CLI, run the msi again and choose uninstall.
apt-get for Bash on Ubuntu on Windows
If you don't have Bash on Windows, install it.
Open the Bash shell.
Modify your sources list.
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \ sudo tee /etc/apt/sources.list.d/azure-cli.listRun the following sudo commands:
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893 sudo apt-get install apt-transport-https sudo apt-get update && sudo apt-get install azure-cliRun the CLI from the command prompt with the
azcommand.
Note
When you install with apt-get, az component isn't supported.
To update the CLI, run sudo apt-get update && sudo apt-get install azure-cli again.
To uninstall, run sudo apt-get remove azure-cli.
apt-get for Debian/Ubuntu
For Debian/Ubuntu based systems, you can install Azure CLI 2.0 via apt-get.
Modify your sources list.
32-bit system
echo "deb https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \ sudo tee /etc/apt/sources.list.d/azure-cli.list64-bit system
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ wheezy main" | \ sudo tee /etc/apt/sources.list.d/azure-cli.list
Run the following sudo commands:
sudo apt-key adv --keyserver packages.microsoft.com --recv-keys 417A0893 sudo apt-get install apt-transport-https sudo apt-get update && sudo apt-get install azure-cliRun the CLI from the command prompt with the
azcommand.
Note
When you install with apt-get, az component isn't supported.
To update the CLI, run sudo apt-get update && sudo apt-get install azure-cli again.
To uninstall, run sudo apt-get remove azure-cli.
Docker
We maintain a Docker image preconfigured with the Azure CLI 2.0.
Install the CLI using docker run.
docker run azuresdk/azure-cli-python:<version>
See our Docker tags for available versions.
Note
If you want to pick up the SSH keys from your user environment,
you can use -v ${HOME}:/root to mount $HOME as /root.
docker run -v ${HOME}:/root azuresdk/azure-cli-python:<version>
The CLI is installed on the image as the az command in /usr/local/bin.
Note
The Docker image does not support the az component feature.
To update the Azure CLI 2.0, use docker run to install the latest image, or the specific image that you want.
Linux
If you don't have it, install Python.
Depending on your Linux distribution, install the prerequisites.
Platform | Prerequisites ----------------------|--------------------------------------------- Ubuntu 15.10 or 16.04 | sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential Ubuntu 12.04 or 14.04 | sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev Debian 8 | sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev build-essential Debian 7 | sudo apt-get update && sudo apt-get install -y libssl-dev libffi-dev python-dev CentOS 7.1 or 7.2 | sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel RedHat 7.2 | sudo yum check-update; sudo yum install -y gcc libffi-devel python-devel openssl-devel SUSE OpenSUSE 13.2 | sudo zypper refresh && sudo zypper --non-interactive install gcc libffi-devel python-devel openssl-develInstall the CLI with one
curlcommand.curl -L https://aka.ms/InstallAzureCli | bashYou may have to restart your command shell for some changes to take effect.
exec -l $SHELLRun the CLI from the command prompt with the
azcommand.
Note
When you install with InstallAzureCli, az component update isn't supported.
To update to the latest CLI, run curl -L https://aka.ms/InstallAzureCli | bash again.
To uninstall, see the manual uninstall instructions.
Troubleshooting
Errors with curl redirection
If you get an error from the curl command regarding the -L parameter, or an error saying "Object Moved", try using the full url instead of the aka.ms url:
# If you see this:
curl -L https://aka.ms/InstallAzureCli | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 175 100 175 0 0 562 0 --:--:-- --:--:-- --:--:-- 560
bash: line 1: syntax error near unexpected token `<'
'ash: line 1: `<html><head><title>Object moved</title></head><body>
#### Try this instead:
curl https://azurecliprod.blob.core.windows.net/install | bash
Uninstall
If you used the script at https://aka.ms/InstallAzureCli to install the CLI, you can uninstall it with these steps.
Remove the installed files.
rm -r <install location>/lib/azure-cli rm <install location>/bin/azDelete the line
<install location>/lib/azure-cli/az.completionfrom<install location>/.bash_profile.
Note
The default install location is /Users/<username>.
If you used apt-get, Docker, or the msi to install the CLI, use the same tool to uninstall it.
Reporting issues and feedback
If you encounter any bugs with the tool,
file an issue in the Issues section of our GitHub repo.
To provide feedback from the command line, try the az feedback command.




