Install Azure CLI on Linux manually
If there's no package for the Azure CLI for you your distribution, install the CLI manually by running a script.
It's strongly recommend to install the CLI with a package manager. A package manager makes sure you always get the latest updates, and guarantees the stability of CLI components. Check and see if there is a package for your distribution before installing manually.
The CLI requires the following software:
Install or update
Both installing and updating the CLI requires re-running the install script. Install the CLI by running
curl -L https://aka.ms/InstallAzureCli | bash
The script can also be downloaded and run locally. You may have to restart your shell in order for changes to take effect.
You can then run the Azure CLI with the
az command. To sign in, use az login command.
If the CLI can open your default browser, it will do so and load a sign-in page.
Otherwise, you need to open a browser page and follow the instructions on the command line to enter an authorization code after navigating to https://aka.ms/devicelogin in your browser.
Sign in with your account credentials in the browser.
To learn more about different authentication methods, see Sign in with Azure CLI.
Here are some common problems seen during a manual installation. If you experience a problem not covered here, file an issue on github.
curl "Object Moved" error
If you get an error from
curl related to the
-L parameter, or an error message including the text "Object Moved", try using
the full URL instead of the
curl https://azurecliprod.blob.core.windows.net/install | bash
az command not found
If you can't run the command after installation and using
zsh, clear your shell's command hash cache. Run
and check if the problem is resolved.
The issue can also occur if you didn't restart your shell after installation. Make sure that the location of the
az command is in your
$PATH. The location
az command is
If you decide to uninstall the Azure CLI, we're sorry to see you go. Before you uninstall, use the
az feedback command to let us know
what could be improved or fixed. Our goal is to make the Azure CLI bug-free and user-friendly. If you found a bug, we'd appreciate it if you file a GitHub issue.
Uninstall the CLI by directly deleting the files from the location chosen at the time of installation. The default install location is
Remove the installed CLI files.
rm -r <install location>/lib/azure-cli rm <install location>/bin/az
$HOME/.bash_profilefile to remove the following line:
zsh, reload your shell's command cache.
Now that you've installed the Azure CLI, take a short tour of its features and common commands.