Sunday, January 31, 2021

Azure/PowerShell: Listing All Locations

Certain Azure PowerShell cmdlets require a location parameter value be specified (e.g. East Asia, West US 2, Brazil South, etc.). In order to display list of of locations the following PowerShell script can be invoked:

Get-AzureRmLocation | Select-Object -Property Location, DisplayName

The location parameter of a cmdlet should be passed the DisplayName of a given resource location. The below example demonstrates this where a new resource group is created for Norway East:

New-AzResourceGroup `
    -Name 'rg_ahha_take_on_me' `
    -Location 'Norway East' | Out-Null

Invoking the above script on January 31, 2020 listed the following locations:

No comments :

Post a Comment