Install Azure CLI On Windows

Install Azure CLI On Windows

In this Azure tutorial, we will discuss Install Azure CLI On Windows. Along with this, we will also discuss a few other topics below

  • Update Azure CLI Version
  • Install Azure CLI Linux
  • Unable to locate package azure-cli

Install Azure CLI On Windows

Let’s discuss an interesting topic, i.e., Install Azure CLI On Windows. But before starting the installation, you can check out a quick tutorial on Azure CLI for a better understanding.

Azure CLI windows

Assuming we have some idea about Azure CLI, let’s start with the main topic, i.e., Installing Azure CLI On Windows.

You can install the Azure CLI On Windows in two ways.

  • Use the Microsoft Installer (MSI)

You can download the Azure CLI executable file from the path below and install that on your machine

https://aka.ms/installazurecliwindows

Once you access the above URL will prompt you to save the Azure CLI executable file in your local path. It will take a few minutes to download the executable file. Once you download the executable file, You can double-click on the executable file to install the Azure CLI setup.

How to Install Azure CLI On Windows

As the next step, select the “I accept the terms in the License Agreement” option and click the Install button to start the installation process.

install azure cli on windows without admin rights
  • Microsoft Installer (MSI) with PowerShell command (install Azure CLI on Windows PowerShell)

Another way is to install the Azure CLI using the PowerShell cmdlet. you can use the below PowerShell cmdlet to install the Azure CLI.

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

Note: One important thing to note here is. If you have already installed the Azure CLI on your machine and are trying to run the PowerShell cmdlet on top of that, it will update the Azure CLI to the latest version.

After executing the script, you might get the error ” Invoke-WebRequest: The operation has timed out”. The complete error message is as follows.

Invoke-WebRequest: The operation has timed out.
At line:1 char:1

  • Invoke-WebRequest -Uri https://aka.ms/installazurecliwindows -OutFile …
  • ~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebReq
      uest) [Invoke-WebRequest], WebException
    • FullyQualifiedErrorId: WebCmdletWebResponseException, Microsoft.PowerShell.Comm
      and.InvokeWebRequestCommand

But if you try executing the same script once or twice, it will work for you, and Azure CLI will install successfully without any issues. This is how we can install Azure CLI On Windows.

You can also check out How to install Azure CLI on Mac.

Install Azure CLI Linux

Well, it’s quite easy to install the Azure CLI in Linux. There are multiple ways to install Azure CLI on Linux, But there is a very quick way to install Azure CLI on a Linux machine by using a single command to install Azure CLI on your Linux machine.

curl -L https://aka.ms/InstallAzureCli | bash

Another important point is that once you finish the installation, don’t forget to restart your shell to view the changes.

Update Azure CLI Version

Suppose you already have the Azure CLI installed on your machine and want to upgrade to the latest version of Azure CLI, then you can execute the below PowerShell cmdlet to upgrade the Azure CLI version to the latest one.

az upgrade

After installing Azure CLI, you can check out How to log in to Azure CLI.

Run the Azure CLI

Okay, now, we have done with the installation of Azure CLI, and then we have discussed how to update the Azure CLI version. Now, Let’s discuss How to run the Azure CLI. You can use the Windows command prompt or PowerShell to execute the commands. Follow the below steps to run the Azure CLI.

Step-1: Run the below az command to login

az login

 Once you execute the above PowerShell cmdlet, it will prompt you to sign in with the Browser.

Step 2: Enter your account credentials to log in.

FAQs

In which operating system, we can use Azure CLI?

Answer: Windows, Linux, macOS, etc.

How to uninstall Azure CLI

If, By chance, you have decided to uninstall the Azure CLI, then you can uninstall the Azure CLI using the below steps.

  • If you are using Windows 10, To uninstall the Azure CLI, Navigate to Start > Settings > Apps.
  • If you are using Windows 7 or Windows 8, To uninstall the Azure CLI, Navigate to Start > Control Panel > Programs > Uninstall a program.

Unable to locate package azure-CLI [Soluton]

There might be a chance that you will get an error “Unable to locate package azure-cli” . If you are getting this error, then you can fix the same issue by running the below cmdlet

sudo apt-get update && sudo apt-get upgrade

You may also like following the articles below

Wrapping Up

In this article, we have discussed Install Azure CLI On Windows. Along with this, we have also discussed Update Azure CLI Version. Finally, we have discussed Installing Azure CLI Linux. I hope you have enjoyed this article !!!