View available regions for Azure services using PowerShell

View available regions for Azure services using PowerShell

Q. How can I view the Azure regions using PowerShell AzureRM?

A. I could not find an easy cmdlet to view the regions but instead you can see the regions for certain resource types. Picking virtual machines (which are available in all regions) is an easy way to see all the Azure regions. Below is example code. Note if you wanted to check the regions for a certain type of resource change the virtualMachines to the resource type you want to check for. You can also check via the portal at https://azure.microsoft.com/en-us/regions/#services.

$resources = Get-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute
$resources.ResourceTypes.Where{($_.ResourceTypeName -eq 'virtualMachines')}.Locations
East US
East US 2
West US
Central US
South Central US
North Europe
West Europe
East Asia
Southeast Asia
Japan East
Japan West
North Central US
Brazil South

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish