Skip to content

Simple but powerful script to clean all resources from subscription, include disable subscriptions as well

License

Notifications You must be signed in to change notification settings

ozbillwang/azure-subscription-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

azure-subscription-cleaner

Simple but powerful script with AZ 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. 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 <sub_id or sub_name>

$ az account show

do the clean

When you are ready, just run below command

$ ./sub_cleaner.sh

About

Simple but powerful script to clean all resources from subscription, include disable subscriptions as well

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages