Do not do this in production systems, you can use this for clearing up old test resource groups.
- Open Azure Portal https://portal.azure.com
- Click on Resource Groups
- Select the Resource Groups that you want to delete
- Click “Assign tags”
- Assign name "deleteme"
- Open PowerShell
az login
az account set -s "yoursubid"
az group list --tag deleteme --query [].name -o tsv | ForEach-Object {az group delete --no-wait -n $_}
- The script will start executing after you have confirmed
"y"
for every group - You can amend point 3 above if you want to bypass individual
"y"
to delete step