DevOps | Scripts | Automation

Azure CLI

How to Install Azure CLI?

You can install Azure CLI on multiple platforms like Windows, Unix and Mac OS. Although the method of installation is shown on the Microsoft Portal, we will summarize here the installation for Windows OS.

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Latest Version

The latest version for Azure CLI is 2.11.1 as of writing this article but you can keep checking the latest available version on the link given above.

Release Notes: https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli?view=azure-cli-latest

Prerequisite

  • Windows OS: There are no prerequisites as such for installing the Azure CLI on Windows operating system because it can be launched from a command prompt or through PowerShell after installation.
  • macOS: This CLI package has been tested for macOS versions 10.9 and later.
  • Linux with Apt: If you are running a distribution that comes with apt, such as Ubuntu or Debian, there’s an x86_64 package available for the Azure CLI. This package has been tested with and is supported for:
    • Ubuntu trusty, xenial, artful, bionic, and disco
    • Debian wheezy, jessie, stretch, and buster
  • Linux 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.
  • Linux with Zypper: For Linux distributions with zypper, such as openSUSE or SLES, there’s a package available for the Azure CLI. This package has been tested with openSUSE Leap 15.1, and SLES 15.

Windows OS AZ CLI Installation

You can install Azure CLI on Windows OS through the MSI package or through the script. To install through the MSI package, download the client from the below Microsoft URL.

https://aka.ms/installazurecliwindows

Once downloaded, install this tool like other software by just clicking next -> next.

CLI Client installation with PowerShell

To install the CLI client with PowerShell, use the below code in PowerShell console. The same has been available on the Microsoft portal.

Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile .\AzureCLI.msi; Start-Process msiexec.exe -Wait -ArgumentList '/I AzureCLI.msi /quiet'; rm .\AzureCLI.msi

After installation, open CMD or PowerShell and type ‘AZ’ command in PowerShell or CMD and press enter, you will see the Azure command and subgroups listed in the console.

To check Azure CLI verion, use the below command.

az --version

The above output shows the CLI version and Interactive version. You can also see the path for the Azure CLI extension for Python. If there are any CLI updates available then it will be notified on the console and you can upgrade it with “Az Upgrade” command.

You can start the interactive session with Azure CLI using below command,

az interactive

Once you type the above command, you will be entered into interactive session and when you start typing any cli command, intellisense would work. For example, type ver and it will show the version command completion.

Another example,

At the bottom of the line, you can see various function keys.

To come out of the interactive session window, press ctrl+D.

One thought on “How to Install Azure CLI?

Comments are closed.