How To Update Azure CLI

However, to use the latest features, security patches, and improvements, keeping your Azure CLI up to date is crucial. In this detailed article, I’ll walk you through how to update Azure CLI using multiple methods, tailored for different operating systems and environments. Whether you’re a developer or an admin, this step-by-step tutorial will ensure your Azure CLI stays current.

How To Update Azure CLI

Why You Should Regularly Update Azure CLI

Before we jump into the update methods, let’s quickly cover why updating Azure CLI is essential:

  • Access to new features: Microsoft continuously adds new commands and capabilities.
  • Security patches: Updates often include critical security fixes.
  • Bug fixes: Resolve issues that might cause unexpected behavior.
  • Improved performance: Optimizations make your CLI experience smoother.
  • Compatibility: Stay compatible with the latest Azure services and APIs.

Before updating, it’s good practice to check your current Azure CLI version. Open your terminal or command prompt and run:

az --version

After executing the above command, we got the version number as shown in the screenshot below.

How to Check Your Current Azure CLI Version

Method 1: Updating Azure CLI on Windows

Using the MSI Installer (Recommended)

To update Azure CLI, follow the steps below.

If you installed Azure CLI using the MSI installer on Windows, the easiest way to update is to download and run the latest MSI installer.

  1. Visit the Azure CLI Windows download page.
  2. Download the latest MSI installer.
How To Update Azure CLI

3. Run the installer and follow the prompts. It will detect your existing installation and update it.

how to update azure cli version
update azure cli windows

Note: This method is preferred for users who installed via MSI because it handles all dependencies and system PATH settings automatically.

Now, let us rerun the command below to check the updated version after the completion of the update process.

az --version

You can see that the Azure CLI has been updated successfully, as shown in the screenshot below.

update azure cli version

Using PowerShell (For Chocolatey Users)

If you installed Azure CLI using Chocolatey, update it via PowerShell:

choco upgrade azure-cli

This command upgrades Azure CLI to the latest version available in the Chocolatey repository.

Method 2: Updating Azure CLI on macOS

Using Homebrew (Recommended for macOS Users)

Homebrew is the most popular package manager for macOS, and if you installed Azure CLI this way, updating is simple.

  1. Open Terminal.
  2. Run the following commands:
brew update
brew upgrade azure-cli
  • brew update Updates Homebrew itself.
  • brew upgrade azure-cli Upgrades Azure CLI to the latest version.

Using the Manual Installer

If you installed Azure CLI manually via the installer script, you can update by re-running the installation script:

curl -sL https://aka.ms/InstallAzureCLIDeb | bash

This script works for both Debian-based Linux and macOS, and it will update your Azure CLI to the latest version.

Method 3: Updating Azure CLI on Linux

Using Package Man