Install Azure PowerShell

This document provides instructions for installing Azure PowerShell on various platforms. Azure PowerShell is a set of cmdlets that you can use to manage your Azure subscription directly from the command line.

Note: For new development, we recommend using the Az PowerShell module. The Az module is the latest version of Azure PowerShell, and it's the only module that will receive future updates. AzureRM is currently in maintenance mode and will only receive critical bug fixes.

Prerequisites

Before you begin, ensure you have the following:

Installation Methods

You can install Azure PowerShell using one of the following methods:

Method 1: Using PowerShellGet (Recommended)

This is the recommended method for installing the latest version of the Az module.

Windows

To install the Az module on Windows, open a PowerShell session as an administrator and run the following commands:

Install-Module -Name Az -AllowClobber -Scope CurrentUser

If you want to install for all users, run the command without the -Scope CurrentUser parameter (requires administrator privileges).

For detailed instructions and troubleshooting, refer to the official PowerShellGet installation guide.

macOS and Linux

On macOS and Linux, you can use PowerShell Core. Open your terminal and run:

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

For detailed instructions and troubleshooting, refer to the official PowerShell Core installation guide.

Method 2: Using the Microsoft Store (Windows Only)

You can also install Azure PowerShell from the Microsoft Store. This method automatically handles updates.

Search for "Azure PowerShell" in the Microsoft Store app or visit the Microsoft Store page.

Verification

After installation, verify that Azure PowerShell is installed correctly by opening a new PowerShell session and running:

Get-InstalledModule -Name Az

You should see information about the installed Az module, including its version.

Connecting to Azure

To connect to your Azure account, use the Connect-AzAccount cmdlet:

Connect-AzAccount

This will open a browser window or prompt for credentials to authenticate with Azure.

Next Steps