Created
July 25, 2019 15:26
-
-
Save gambtho/7b0e1c74bcba26151d02964df2e1c9a6 to your computer and use it in GitHub Desktop.
clean-up your 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
#!/bin/bash | |
# NOTE: Be careful as this code in intended to delete ALL Resources in a subscription. Use at your own risk. | |
# https://stackoverflow.com/a/56139987 | |
# Set The correct Subscription | |
az account set -s "<Subscription_name / Id>" | |
# Get All resource groups and loop to delete them | |
for rg_name in `az group list -o tsv --query [*].name`; do | |
echo Deleting ${rg_name} | |
az group delete -n ${rg_name} --yes --no-wait | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment