Install Azure PowerShell on Windows | Microsoft Learn 


The Az PowerShell module is a rollup module. Installing the Az PowerShell module downloads the generally available modules and makes their cmdlets available for use.

The recommended installation method and PowerShell version for the Az PowerShell module:

  • Install from the PowerShell Gallery
  • Use with PowerShell version 7 or higher

This article explains how to install the Az PowerShell module on Windows from the PowerShell Gallery.

Prerequisites

  • Run the following command from PowerShell to determine your PowerShell version:

    PowerShellCopy
    $PSVersionTable.PSVersion
    
  • Determine if you have the AzureRM PowerShell module installed:

    PowerShellCopy
    Get-Module -Name AzureRM -ListAvailable
    

     Important

    If you have the AzureRM PowerShell module installed, see Az and AzureRM coexistence before proceeding.

  • Set the PowerShell execution policy to remote signed or less restrictive

    • Check the PowerShell execution policy:

      PowerShellCopy
      Get-ExecutionPolicy -List
      
    • Set the PowerShell execution policy to remote signed:

      PowerShellCopy
      Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
      
  • For more information about execution policies, see about_Execution_Policies.

Installation

Use the Install-Module cmdlet to install the Az PowerShell module:

PowerShellCopy
Install-Module -Name Az -Repository PSGallery -Force

Update the Az PowerShell module

Use Update-Module to update to the latest version of the Az PowerShell module:

PowerShellCopy
Update-Module -Name Az -Force

Updating the Az PowerShell module using Update-Module doesn't remove old versions of the Az PowerShell module from your system.

Uninstallation

To remove the Az PowerShell module, see Uninstall the Azure PowerShell module.

Sign in

To start managing your Azure resources with the Az PowerShell module, launch a PowerShell session and run Connect-AzAccount to sign in to Azure:

Azure PowerShellCopy
Connect-AzAccount

Use your Azure account login credentials to log into the browser window that opens.

You need to repeat this step for every new PowerShell session you start. To learn how to persist your Azure sign-in across PowerShell sessions, see Azure PowerShell context objects.

Troubleshooting

For solutions to common installation issues with the Az PowerShell module, see Troubleshoot installation problems with the Az PowerShell module.

Provide feedback

To file an issue about the Az PowerShell module, see: File an issue on GitHub

To provide feedback from within a PowerShell session, use the Send-Feedback cmdlet.

Next Steps

To learn more about managing your Azure resources with the Az PowerShell module, see Get Started with Azure PowerShell.