Install Azure CLI on Windows (Simple & Best Method)

Azure CLI stands for Azure Command-Line Interface. It is a cross-platform command-line interface that allows Azure users to manage Azure resources directly from a command line interface. With the Azure CLI, we can create, update, delete, and manage Azure resources at scale. In this post, I will walk you through the steps to install the Azure CLI on Windows using a PowerShell script. Once the installation is done we will also check if the Azure CLI has been correctly installed or not.

Steps to Install Azure CLI on Windows PowerShell

Step 1: Open Windows PowerShell as an administrator

Step 2: Create a new PowerShell file named azcli.ps1

code azcli.ps1

Step 3: Copy and paste the following code into the PowerShell file

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

Step 4: Save the file and execute it by running the following command

.\azcli.ps1
Install Azure CLI on Windows with PowerShell Script

Wait for the installation to get completed.

Final Step: To verify that the Azure CLI has been installed, run the following command

az or az --version

If the Azure CLI is installed successfully, you should see the list of all Azure CLI commands and the version of the Azure CLI when you run the az --version command.

Check Azure CLI is installed successfully or not by running az command
Check Azure CLI Version by running az --version

Related Articles:

👉 Install Azure PowerShell and Azure AD PowerShell

👉 How to Find Azure VM Username and Password

👉 Docker Shell Commands: Docker Containers

👉 Azure Cloud Shell: Setup Guide and Tutorial