author | ms.author | ms.date | ms.topic | ms.service | ms.custom |
---|---|---|---|---|---|
dbradish-microsoft |
dbradish |
06/17/2024 |
include |
azure-cli |
devx-track-azurecli, linux-related-content |
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's a package for your distribution before installing manually.
The install script for the Azure CLI requires the following software:
- Python 3.8.x, 3.9.x, 3.10.x - For more information, see Support lifecycle - Python dependency.
- libffi
- OpenSSL 1.0.2
Important
The install script only works on Python 3.8.x, 3.9.x, or 3.10.x. This install script does not work on Python 3.11.x or later versions.
Both installing and updating the Azure CLI requires rerunning the install script:
curl -L https://aka.ms/InstallAzureCli | bash
The script can also be downloaded and run locally. You may have to restart your shell for the changes to take effect.
[!INCLUDE uninstall-boilerplate.md]
Uninstall the CLI by directly deleting the files from the location chosen at the time of installation. The default install location is the user's home directory ($HOME).
-
Remove the installed CLI files.
rm -r <install location>/lib/azure-cli rm <install location>/bin/az
-
Modify your
$HOME/.bash_profile
file to remove the following line:<install location>/lib/azure-cli/az.completion
-
If using
bash
orzsh
, reload your shell's command cache.hash -r
[!INCLUDE remove-data-boilerplate.md]
Here are some common problems seen during a manual installation. If you experience a problem not covered here, file an issue on GitHub.
The Azure CLI has dropped support for Python 2.7 since version 2.1.0.
On your system, there may be a Python version that predates the requirement of Python 3.6.x.
Find a replacement python3
package.
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 aka.ms
redirect:
curl https://azurecliprod.blob.core.windows.net/install | bash
If you can't run the command after installation using bash
or zsh
, try clearing your shell's command hash cache and check if the problem is resolved.
hash -r
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
of the az
command is ...
<install path>/bin
[!INCLUDEconfigure-proxy]
In order to get the installation scripts, your proxy needs to allow HTTPS connections to the following addresses:
https://aka.ms/
https://azurecliprod.blob.core.windows.net/
https://pypi.python.org
- Endpoints used by your distribution's package manager (if any) for core packages
[!INCLUDEtroubleshoot-wsl.md]