Azure PowerShell Reference

Install and manage Azure resources with PowerShell

Installing Azure PowerShell

This guide provides instructions on how to install the Azure PowerShell module. Choose the installation method that best suits your operating system and needs.

Windows
macOS
Linux

For Windows Users

The recommended way to install Azure PowerShell on Windows is by using the Microsoft Store or PowerShellGet.

Method 1: Using the Microsoft Store (Recommended for most users)

This method provides automatic updates and is the simplest way to get started.

  1. Open the Microsoft Store.
  2. Search for "Azure PowerShell".
  3. Click "Get" or "Install" to download and install the latest version.
Method 2: Using PowerShellGet

This method is ideal if you need more control or are working in an environment where the Store is not available.

  1. Open Windows PowerShell as an administrator.
  2. Ensure you have the latest version of PowerShellGet installed:
    Install-Module -Name PowerShellGet -Force -AllowClobber
  3. Install the Azure PowerShell module:
    Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

    Use -Scope AllUsers if you have administrator privileges and want to install for all users.

  4. If prompted to install from an untrusted repository, type Y and press Enter.
Tip: To update Azure PowerShell using PowerShellGet, run:
Update-Module -Name Az

For macOS Users

On macOS, the Azure PowerShell module is installed using PowerShellGet.

  1. Open Terminal.
  2. Install the Azure PowerShell module:
    Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
  3. If prompted to install from an untrusted repository, type Y and press Enter.
Note: PowerShell on macOS requires the PowerShell Core runtime. If you don't have it installed, you may need to install it first. Visit official PowerShell documentation for macOS for details.

For Linux Users

On Linux distributions, the Azure PowerShell module is installed using PowerShellGet.

  1. Open your terminal.
  2. Install the Azure PowerShell module:
    Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
  3. If prompted to install from an untrusted repository, type Y and press Enter.
Note: PowerShell on Linux requires the PowerShell Core runtime. If you don't have it installed, you may need to install it first. Refer to the official PowerShell documentation for Linux for specific distribution instructions.

Verifying Installation

After installation, you can verify that the Azure PowerShell module is installed and working correctly by running the following command in your PowerShell session:

Get-Module -ListAvailable -Name Az

This command should list the installed Azure PowerShell modules. You can also try logging in to your Azure account:

Connect-AzAccount

This will prompt you to sign in to your Azure subscription.

Troubleshooting Common Issues

For more detailed information, troubleshooting steps, and specific scenarios, please refer to the official Azure PowerShell installation guide.