Last active
June 29, 2024 23:34
-
-
Save danuw/0983f4282aa760492037bb70f27ce5c5 to your computer and use it in GitHub Desktop.
az cli commands to extract azure regions and their locations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# copy paste in terminal - this excludes locations that have no coordinates - usually called Logical regions (like USA, Europe, Asia etc...) | |
#az account list-locations --query '[?metadata.latitude != null].{RegionName:name,Longitude:metadata.longitude,Latitude:metadata.latitude}' > azure-regions2.json | |
#For the Carbon Aware SDK, use to match current format | |
az account list-locations --query '[?metadata.latitude != null].{Name:name,Longitude:metadata.longitude,Latitude:metadata.latitude}' | jq 'reduce .[] as $item ({}; .[$item.Name] = $item)' > azure-regions2.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment