Install Azure CLI with yum

For Linux distributions with yum such as RHEL, Fedora, or CentOS, there's a package for the Azure CLI. This package has been tested with RHEL 7.7, RHEL 8, Fedora 24 and higher, CentOS 7 and CentOS 8.

The current version of the Azure CLI is 2.10.1. For information about the latest release, see the release notes. To find your installed version and see if you need to update, run az --version.


The RPM package of the Azure CLI depends on the python3 package. On your system, this may be a Python version which predates the requirement of Python 3.6.x. If this affects you, find a replacement python3 package.

Be aware that Python 2 has reached the end of life on January 1, 2020, and will no longer receive updates. Azure CLI has dropped support for Python 2.7 since version 2.1.0. New versions no longer guarantee to run with Python 2.7 correctly.


  1. Import the Microsoft repository key.

    sudo rpm --import
  2. Create local azure-cli repository information.

    sudo sh -c 'echo -e "[azure-cli]
    name=Azure CLI
    gpgkey=" > /etc/yum.repos.d/azure-cli.repo'
  3. Install with the yum install command.

    sudo yum install azure-cli

Run the Azure CLI with the az command. To sign in, use az login command.

  1. Run the login command.

    az login

    If the CLI can open your default browser, it will do so and load an Azure sign-in page.

    Otherwise, open a browser page at and enter the authorization code displayed in your terminal.

  2. 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 when installing with yum. If you experience a problem not covered here, file an issue on github.

Install on RHEL 7.6 or other systems without Python 3

If you can, please upgrade your system to a version with official support for python3 package. Otherwise, you need to first install a python3 package, either build from source or install through some additional repo. Then you can download the package and install it without dependency.

$ sudo yum install yum-utils
$ sudo yumdownloader azure-cli
$ sudo rpm -ivh --nodeps azure-cli-*.rpm

If you have setup python3 but are still getting an error python3: command not found when trying to run the cli, you need to add it to your path.

$ scl enable rh-python36 bash

Proxy blocks connection

If you're unable to connect to an external resource due to a proxy, make sure that you've correctly set the HTTP_PROXY and HTTPS_PROXY variables in your shell. You will need to contact your system administrator to know what host(s) and port(s) to use for these proxies.

These values are respected by many Linux programs, including those which are used in the install process. To set these values:

# 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]


If you are behind a proxy, these shell variables must be set to connect to Azure services with the CLI. If you are not using basic auth, it's recommended to export these variables in your .bashrc file. Always follow your business' security policies and the requirements of your system administrator.

You may also want to explicitly configure yum to use this proxy at all times. Make sure that the following lines appear under the [main] section of /etc/yum.conf:

# ...
proxy=http://[proxy]:[port] # If your proxy requires https, change http->https
proxy_username=[username] # Only required for basic auth
proxy_password=[password] # Only required for basic auth

In order to get the Microsoft signing key and get the package from our repository, your proxy needs to allow HTTPS connections to the following address:


CLI fails to install or run on Windows Subsystem for Linux

Since Windows Subsystem for Linux (WSL) is a system call translation layer on top of the Windows platform, you might experience an error when trying to install or run the Azure CLI. The CLI relies on some features that may have a bug in WSL. If you experience an error no matter how you install the CLI, there's a good chance it's an issue with WSL and not with the CLI install process.

To troubleshoot your WSL installation and possibly resolve issues:

  • If you can, run an identical install process on a Linux machine or VM to see if it succeeds. If it does, your issue is almost certainly related to WSL. To start a Linux VM in Azure, see the create a Linux VM in the Azure Portal documentation.
  • Make sure that you're running the latest version of WSL. To get the latest version, update your Windows 10 installation.
  • Check for any open issues with WSL which might address your problem. Often there will be suggestions on how to work around the problem, or information about a release where the issue will be fixed.
  • If there are no existing issues for your problem, file a new issue with WSL and make sure that you include as much information as possible.

If you continue to have issues installing or running on WSL, consider installing the CLI for Windows.


Update the Azure CLI with the yum update command.

sudo yum update azure-cli


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.

  1. Remove the package from your system.

    sudo yum remove azure-cli
  2. If you don't plan to reinstall the CLI, remove the repository information.

    sudo rm /etc/yum.repos.d/azure-cli.repo
  3. If you don't use any other Microsoft packages, remove the signing key.

    MSFT_KEY=`rpm -qa gpg-pubkey /* --qf "%{version}-%{release} %{summary}\n" | grep Microsoft | awk '{print $1}'`
    sudo rpm -e --allmatches gpg-pubkey-$MSFT_KEY

Next Steps

Now that you've installed the Azure CLI, take a short tour of its features and common commands.