Created
February 7, 2020 03:53
-
-
Save bfleming-ciena/f7aea9029edebe44de221628023de33c to your computer and use it in GitHub Desktop.
Dump all azure resources
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
# Dumps all resources in all subscriptions and pulls fields related to the resource and most | |
# importantly, the tags currently applied. | |
# | |
# I was using this to import into an excel spreadsheet, which we then reviewed and modified the tag values. | |
# Then I would dump the spreadsheet back to csv and feed it into the python script which would go and | |
# update the tags. | |
echo "id,location,it_Environment,it_App,it_Role,it_Owner,name,resource group,kind,type,tags" | |
for i in $(az account list -o tsv|cut -f2); do | |
az resource list --subscription="$i" | jq -r '.[] | [.id,.location,"","","","",.name,.resourceGroup,.kind,.type,(.tags | tostring)] | @csv' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment