Install Azure CLI on Windows 11 or 10 using Powershell or CMD

In the landscape of cloud computing, Microsoft Azure stands tall as a powerful cloud platform that offers a plethora of services for businesses and developers alike. To harness the full potential of Azure Cloud, it’s crucial to have the Azure Command-Line Interface (Azure CLI) at your disposal. In this piece of tutorial, we’ll go through the step-by-step procedure of installing Azure CLI on your Windows 10 or 11 machine but using PowerShell or Command prompt not by downloading from its website manually.

Why Azure CLI?

Before starting the tutorial, let’s understand why Azure CLI is a must-have tool for anyone working with Microsoft Azure:

  • Azure CLI is a cross-platform tool, hence available for all system users whether it is Linux, macOS, or Windows.
  • It empowers users to automate complex tasks, manage resources efficiently, and create scripts for Azure workflows.
  • Because of vast library commands, users can interact with Azure services, manage virtual machines, create databases, and much more.
  • Azure CLI seamlessly integrates with Azure PowerShell, Azure SDKs, and other Azure tools, giving a cohesive Azure management experience.

Prerequisites

To complete this tutorial, users must have the following things:

  • Windows OS 10 or 11 with administrative privileges.
  • PowerShell access to use Azure CLI
  • Internet connection to download the required files for the installation of Azure CLI

Step 1: Open PowerShell

Here we are using PowerShell to install the Azure CLI tool, however, the steps will be the same for Command Prompt as well. So, first, open either of them you would like to use under admin rights.

For that click on the Windows Start button and search for PowerShell, after that hover your mouse on it and select the “Run as Administrator” option.

Running Powershell as Admin for Windows 11

Step 2: Check Winget’s Availability

The main motive of this tutorial is to use the command line only for installing Azure on Windows. Hence, we are not going to visit any website to get an executable file of this CLI tool. Therefore, like Linux, we also have a package manager in Windows 10 and 11 systems as well called “Winget“. To check whether it is available or not run the given command and you will see its version number in the output.

winget -v

Step 3: Installing Azure CLI on Windows 10 or 11

In this step, we execute the “winget” command that will not only download the latest available Azure CLI tool setup but even install the same without any need for user intervention.

winget install Microsoft.AzureCLI

Step 4: Azure CLI Version

After completing the installation, first close the PowerShell or command prompt you have used to install it. After that open it again, so that the path of the installed Azure CLI tool can be recognized on our system. Once done, on your CMD or Powershell type the given command which will give you not the only current version of the tool but also the Extension directory for Azure CLI.

az --version
Installing Azure CLI on Windows 10 or 11

Uninstall (optional)

Removal of the Azure CLI from Windows, if not needed using the command terminal is also super easy. Use the same Winget package manager but this time with the “uninstall” parameter.

winget uninstall Microsoft.AzureCLI
Removal of the Azure CLI from Windows

Now we have installed Azure CLI on your Windows but only using CLI. You can further check out the official documentation available for this tool on the Microsoft website to manage Azure resources, automate tasks, and streamline your cloud management workflow.

Other Articles: