ABC DEF
ABC DEF

Reputation: 329

Count of Availability Zones in Each region in Azure for EventGrid , Event Hub

Any az cli command in general to get to know count (1?2?3?) of availability zones in a particular region of Azure? I am trying to get these details for EventGrid and event hub specifically..

Upvotes: 0

Views: 251

Answers (1)

Jahnavi
Jahnavi

Reputation: 7818

Count of Availability Zones in Each region:

To list out the locations and availability zones, use below CLI command.

az account list-locations -o table

enter image description here

To list out the locations and availability zones in eastUS region, use below CLI command.

az account list-locations -o table --query "[?name=='eastus']"

enter image description here

To count the number of availability zones, use length([]) function as shown.

az account list-locations -o table --query "length([])"

enter image description here

To retrieve availability zones and their counts for any specific resources, use below CLI commands: (Eg: EventHub)

az eventhubs eventhub list --resource-group <resourcegroup>  --namespace-name <Namespace> --query "[?contains('Location', 'WestUS')]" -o table
az resource list --resource-group <resourcegroup> --name <resourceName> --resource-type Microsoft.EventGrid/domains --query "length([])"

Upvotes: 1

Related Questions