https://github.com/ozbillwang/azure-subscription-cleaner
Simple but powerful script to clean all resources from subscription, include disable subscriptions as well
https://github.com/ozbillwang/azure-subscription-cleaner
azure bash cleaner cloud subscription
Last synced: about 2 months ago
JSON representation
Simple but powerful script to clean all resources from subscription, include disable subscriptions as well
- Host: GitHub
- URL: https://github.com/ozbillwang/azure-subscription-cleaner
- Owner: ozbillwang
- License: gpl-3.0
- Created: 2021-08-06T12:50:58.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-08-06T19:49:04.000Z (almost 5 years ago)
- Last Synced: 2025-10-25T12:49:06.045Z (8 months ago)
- Topics: azure, bash, cleaner, cloud, subscription
- Language: Shell
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# azure-subscription-cleaner
**Simple but powerful script** with [AZ CLI](https://github.com/Azure/azure-cli) to clean all resources from subscription, include disable subscriptions as well
At begining, I thought it would be a simple task because Azure manages resource via [Resource Group](https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal). But that's not that simple.
### features
- clean all resource groups - with `--no-wait`, you don't wait for the long-running operation to finish.
- clean all blueprint assignments
- clean all deleted key vault - Yes, the key are still there when soft delete is enabled, until you purge it. Otherwise, you will face the error, such as , `key with same name is exist`.
- clean resources from disabled subscription as well, fix the error `the subscription name has more than one match`
### Prerequisite
Make sure you have set the proper subscription
```
$ az account set -s
$ az account show
```
### do the clean
When you are ready, just run below command
```
$ ./sub_cleaner.sh
```