The Azure CLI is the command-line tool for working with Microsoft Azure resources, and grants you access to the CLI through both the Windows Command Prompt (CMD) or PowerShell command-line. You could download and install the Azure CLI using an MSI installer, but if you have the Windows Package Manager installed, there is a quicker, easier way to install the Azure CLI locally using winget!

Install Azure CLI using winget

Once you have the winget Windows Package Manager installed, you can use the following command to install the Azure CLI from either the Windows Command Prompt (CMD) or using PowerShell:

winget install AzureCLI

This command gives you a quick and easy way to install the Azure CLI on your local machine using the Windows Package Manager! It really is that simple!

Install Azure CLI on Windows with Winget 1
installing the Azure CLI using winget

If you are looking to install a specific version of the Azure CLI with winget, you can also specify the desired version. Here’s another example that demonstrates how to explicitly install version 2.7 of the Azure CLI:

winget install AzureCLI --version 2.7.0

As you can see, to install the desired version of the Azure CLI you simply append the --version flag to the command with the exact version to install. You can alternatively use the shorter -v flag as well. If the --version or -v flags are not specified, then the winget install command will install the highest version of the application available within the Windows Package Manager repository service.

Happy Azure CLI scripting!

Chris Pietschmann is a Microsoft MVP, HashiCorp Ambassador, and Microsoft Certified Trainer (MCT) with 20+ years of experience designing and building Cloud & Enterprise systems. He has worked with companies of all sizes from startups to large enterprises. He has a passion for technology and sharing what he learns with others to help enable them to learn faster and be more productive.
Microsoft MVP HashiCorp Ambassador

Discover more from Build5Nines

Subscribe now to keep reading and get access to the full archive.

Continue reading