Skip to content

Instantly share code, notes, and snippets.

@s4parke
Last active November 21, 2022 23:57
Show Gist options
  • Save s4parke/3470581d92917ed5d9d7be6982b2d32e to your computer and use it in GitHub Desktop.
Save s4parke/3470581d92917ed5d9d7be6982b2d32e to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
az account list | jq -r '.[].id' \
| while read sub; do
az account -s $sub; \
az monitor diagnostic-settings subscription list \
| jq -r '.[].name' \
| while read rg; do
echo $rg;
az network vnet list -g $rg --query '[*].addressSpace.addressPrefixes';
done > "PATH_TO_OUTPUT_DIR/$sub";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment