Get-AzureLocation

Get-AzureLocation

Gets the resource types and the Azure data center locations that support them.

Syntax

Get-AzureLocation [ <CommonParameters>]

Detailed Description

The Get-AzureLocation cmdlet gets the Azure data center locations that support each resource type. This cmdlet returns all resource types and locations. It has no parameters.

A resource is a user-managed entity, such as a website, database server, or database. When you create a resource, you need to specify a location, and not every location supports all resource types. Before you create your resources, use this cmdlet to find a location for each resource.

Azure resources are members of a resource group, which is a collection of resources that are deployed as a unit. Resource groups have a location, but the group and its members do not need to be in the same location.

Parameters

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

    You can pipe input to this cmdlet by property name, but not by value.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Azure.Commands.ResourceManagement.Models.PSResourceProviderType

Notes

  • The Get-AzureLocation cmdlet is included in the Azure Resource Manager module beginning in module version 0.8.0.

Examples

Example 1: Get all locations

This command gets all resources and the locations in which they are supported.

PS C:\> Get-AzureLocation
Name                                               Locations
---- ---------
ResourceGroup East Asia, South East Asia, East US, West US, North Central US, South Central US, Central US, North Europe, West Europe biztalkservices/biztalk Central US, West Europe
microsoft.insights/alertrules Central US, East US
microsoft.insights/autoscalesettings Central US, East US
microsoft.insights/components Central US
microsoft.insights/webtests Central US
microsoft.network/Subnets Central US, West Europe
...

Example 2: Get locations that support web sites

This examples shows how to find a location that supports a web site resource and how to use the location in a command to create a web site.

The first command uses the Get-AzureLocation cmdlet to get all resource types and their locations. It pipes the output to the Where-Object cmdlet, which selects only resources with names that include "web" and "site". The output shows that the Azure data centers in the North Central US and Central US support web sites.

The second command uses the New-AzureResource cmdlet to create a new web site. The value of the Location parameter, which is required, is North Central US.

PS C:\> Get-AzureLocation | Where-Object Name -like "*web*site*" 

Name                                               Locations
----                                               ---------
Microsoft.Web/sites             North Central US, Central US


PS C:\>New-AzureResource -Name MyWebSite -Location 'North Central US' ...