Az

Get-AzLocation

Retrieves information about Azure locations.

On this page

Description

The Get-AzLocation cmdlet retrieves information about Azure locations that are available for your subscription.

This cmdlet can be used to discover which locations are available for deploying Azure resources and to obtain details such as the display name and geographic region of each location.

Syntax

Command Parameters
Get-AzLocation

[-Location <String[]>]

[-WarningAction <System.Management.Automation.ActionPreference>]

[-WarningVariable <String>]

[-ErrorAction <System.Management.Automation.ActionPreference>]

[-ErrorVariable <String>]

Parameters

Name Description Type Required?
-Location Specifies the name of a location to retrieve. You can specify multiple location names, separated by commas. String[] No
-WarningAction

Gets or sets the action to take for a warning, such as "Continue", "SilentlyContinue", or "Stop".

System.Management.Automation.ActionPreference No
-WarningVariable

Gets or sets a variable in which to store warning messages.

String No
-ErrorAction

Gets or sets the action to take for an error, such as "Continue", "SilentlyContinue", or "Stop".

System.Management.Automation.ActionPreference No
-ErrorVariable

Gets or sets a variable in which to store error messages.

String No

Examples

Example 1: Get all available Azure locations

This command retrieves all Azure locations available for your subscription.

Get-AzLocation

Example 2: Get a specific Azure location

This command retrieves information about the "East US" Azure location.

Get-AzLocation -Location "East US"

Example 3: Get multiple Azure locations

This command retrieves information about the "West US" and "Central US" Azure locations.

Get-AzLocation -Location "West US", "Central US"

Notes

You can use the output of this cmdlet to specify a location when creating Azure resources using other Azure PowerShell cmdlets.

The available locations can vary based on your Azure subscription and region.

This cmdlet is part of the Az.Resources module. You can install the module using the following command:
Install-Module -Name Az.Resources
For more information about Azure PowerShell modules, see Azure PowerShell documentation.