Brynn
Brynn

Reputation: 117

Azure CLI Show Resource Group Locations

So i'm trying to let the Azure CLI show all the possible location i can use for making a resource group

I am searching for a command similar to az account list-locations the reason i am not using the account list-location line is because for an example one of the locations is Australiacentral2 which does not exist for making a resource group but does exist for account locations

Upvotes: 3

Views: 4434

Answers (3)

Alex Boyarsky
Alex Boyarsky

Reputation: 31

My answer here is just for the history:
az provider list --query "[?namespace=='Microsoft.Resources'].[resourceTypes[?resourceType=='resourceGroups'].locations[]][][]"

The output:

[
  "Central US",
  "East Asia",
  "Southeast Asia",
  "East US",
  "East US 2",
  "West US",
  "West US 2",
  "North Central US",
  "South Central US",
  "West Central US",
  "North Europe",
  "West Europe",
  "Japan East",
  "Japan West",
  "Brazil South",
  "Australia Southeast",
  "Australia East",
  "West India",
  "South India",
  "Central India",
  "Canada Central",
  "Canada East",
  "UK South",
  "UK West",
  "Korea Central",
  "Korea South",
  "France Central",
  "South Africa North",
  "UAE North",
  "Australia Central",
  "Switzerland North",
  "Germany West Central",
  "Norway East",
  "West US 3",
  "Sweden Central"
]

To pass these regions to the az group create command just remove spaces and lowercase.

Upvotes: 0

Johan Stenberg
Johan Stenberg

Reputation: 51

You can also use:

az provider list

which includes available locations for different resource types for your subscription.

Best regards, Johan Stenberg

Upvotes: 2

Charles Xu
Charles Xu

Reputation: 31424

First I need to point out, the Azure CLI command az account list-locations does in fact list all the available areas for your subscription. However, some of these regions such as Australia Central 2 or the India regions require you go apply to deploy there.

And it seems there is no other command can do better than it as the portal. Seems like a gap between the Portal Experience and the CLI experience.

You can bring up this issue directly to the Azure CLI team using this link.

Upvotes: 4

Related Questions