Installing Azure Module for Powershell and Azure CLI (Windows)

Cloud Pills
3 min readApr 21, 2020

--

In this pill you’ll learn how to install, update and start using the AZ module, as well as the Azure CLI. Both tools are used to manage Azure.

1 — Installing AZ Powershell Module (Windows)

Installing the Module

To install the AZ module, you can use this code:

Install-Module -Name Az -AllowClobber

If you see a message saying that the repositoy is untrusted, just answer “ yes” or “ yes to all”

After that, you can run the following command to check if the module was installed:

Get-Module -ListAvailable

Updating the Az Module

If you have installed it using the MSI, you have to download the newer MSI and install it again, but if you followed this tutorial and used the install-module cmdlet, all you need to do is to run the update-module cmdlet:

Update-Module az

You will get the following loading screen:

2 — Installing Azure CLI Module (Windows)

The Azure CLI module is a command line tool written in python that you can manage your Azure resources. It is useful to work with many programming languages and it’s available on many platforms such as Windows, MAC and Linux. It can also run in Docker and in the Azure Cloud Shell.

The following command line should be enough to install it if you don’t have Azure CLI installed yet, and it will update the installation if you have a previous version of the CLI on Windows:

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

After that, if you don’t get any error messages, all you have to do is to restart your current shell, and then you have the ability to use the CLI by typing:

az or az -h

Here is how to install it on different platforms:

In this pill, you have learned how to install Azure CLI and Powershell Az Module. Both of them are excellent tools to manage Azure, if you are asking which one would you install, the best choice is that tool you are familiar with. If you have any questions let us know in the comments.

--

--

Cloud Pills
Cloud Pills

No responses yet