简体   繁体   中英

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

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 .

You can also use:

az provider list

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

Best regards, Johan Stenberg

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM