How to install Az PowerShell module correctly?

Az PowerShell is a powerful and convenient way to manage an Azure subscription with PowerShell scripts. It is an add-on module to the PowerShell scripting tool pre-installed with Windows. It is very useful for automating tasks and monitoring resources on the Azure cloud.

Let’s have a look at the steps to install the Az PowerShell correctly:

Step 1: The Az PowerShell module is only compatible with PowerShell 7.x and later versions. So first step is to make sure that we have the latest version of PowerShell.

To check the PowerShell version currently installed, please run the following command in PowerShell:


This will return a table with the following information:

Check PowerShell Version

In the above example, the installed PowerShell version is 5.1, so we go to step 2.

Step 2 (Optional): Since PowerShell is an open-source project, it is available as a free download on Github. Please follow the instructions provided in the link below to install the latest version of PowerShell:

Step 3: Before we move forward, we would like to make sure that the PowerShell execution policy is set to RemoteSigned (less restrictive) :

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Step 4: Run the command below to install the Az module :

Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

Please note: Make sure that you are connected to the internet while running this command, since the command needs to download the Az PowerShell installation files.

Also, the command may take a while to show the installation progress bar (usually 2 to 3 minutes).

Step 5 (Optional): The PowerShell installation command above does not install all the available sub-modules of Az PowerShell by default. One of the important sub modules not installed by default, is the Az.Synapse sub-module, which is used for managing Azure Synapse Analytics service.

Use the script below to check if a particular submodule e.g. Az.Synapse is installed:

if (Get-Module -ListAvailable -Name Az.Synapse) {
Write-Host "Module exists"
else {
Write-Host "Module does not exist"

If the above code returns “Module does not exist”, Run the command below to install it:

Install-Module -Name Az.Synapse -Scope CurrentUser -Repository PSGallery -Force


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: