Tuesday, January 16, 2024

Azure/PowerShell: Retrieving Azure Regions using Get-AzLocation

A standard for naming Azure resources has been proposed by Microsoft, Define your naming convention. The naming standard specifies that each Azure resource name contains a:

  • Resource type abbreviation
  • Workload/application
  • Environment (.e.g. dev, QA, stage, prod, etc.)
  • Azure region
  • Instance number

A programmatic means to retrieve the Azure regions used by resource name is provided by the Get-AzLocation PowerShell cmdlet. The documentation for Get-AzLocation (Get-AzLocation) describes the cmdlet's functionality as follows:

Get-AzLocation can be invoked as follows to return a list of Azure locations (regions) that can be used in resource names:

Connect-AzAccount

Get-AzLocation | Select-Object -ExpandProperty Location | Sort-Object

Azure regions are not static meaning regions are added and in theory could be removed. As of January 16, 2024 the Get-AzLocation script shown above returns the following list of Azure regions:

asia
asiapacific
australia
australiacentral
australiacentral2
australiaeast
australiasoutheast
brazil
brazilsouth
brazilsoutheast
canada
canadacentral
canadaeast
centralindia
centralus
centraluseuap
eastasia
eastus
eastus2
eastus2euap
europe
france
francecentral
francesouth
germany
germanynorth
germanywestcentral
global
india
israelcentral
italynorth
japan
japaneast
japanwest
korea
koreacentral
koreasouth
northcentralus
northeurope
norway
norwayeast
norwaywest
polandcentral
qatarcentral
singapore
southafrica
southafricanorth
southafricawest
southcentralus
southeastasia
southindia
sweden
swedencentral
switzerland
switzerlandnorth
switzerlandwest
uaecentral
uaenorth
uksouth
ukwest
unitedstates
westcentralus
westeurope
westindia
westus
westus2
westus3

No comments :

Post a Comment