Created
April 22, 2021 17:33
-
-
Save bennage/0a5ec2fead03151c90eac5205acc6be4 to your computer and use it in GitHub Desktop.
bash script for deleting all resource groups matching a pattern
This file contains hidden or 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
#!/usr/bin/env bash | |
groups=$(az group list --query "[?contains(name,'bennage')].name") | |
for row in $(echo "${groups}" | jq -r '.[]'); do | |
_remove() { | |
echo ${row} | |
az group delete -y --no-wait -g ${row} | |
} | |
echo $(_remove) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment