-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpull-quota-data.sh
More file actions
22 lines (20 loc) · 831 Bytes
/
pull-quota-data.sh
File metadata and controls
22 lines (20 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
subscriptions=$(az account list --query "[].id" -o tsv)
# subscriptions="724467b5-bee4-484b-bf13-d6a5505d2b51"
for subscription in ${subscriptions}
do
az account set --subscription "${subscription}"
locations=$(az account list-locations --query "[].name" -o tsv)
# locations="westeurope"
for location in ${locations}
do
ncls=$(az vm list-usage --location "${location}" --query "[].[name.value, currentValue, limit]" -o tsv)
while read -r ncl; do
echo "${subscription} ${location} compute $ncl"
done <<< "$ncls"
ncls=$(az network list-usages --location "${location}" --query "[].[name.value, currentValue, limit]" -o tsv)
while read -r ncl; do
echo "${subscription} ${location} network $ncl"
done <<< "$ncls"
done
done