Skip to content

Performs cleaning operations for Azure Subscription. This is used to removed unused items from development subscription.

License

Notifications You must be signed in to change notification settings

by-pinja/azure-subscription-cleaner

Repository files navigation

Azure Subscription Cleaner

MIT licensed Build Status Dependabot Status

This software periodically deletes unlocked Azure Resources. In our case, it's the first saturday of the month. This is specified with app settings. See deployment/Prepare-Environment.ps1 and deployment/azuredeploy.bicep for configuration example.

To opt out from this, lock your resouce group. for more information, see Opt Out

Build

These commands are assumed to be executed from the same directory this file exists. These commands can also be executed from project directories, but the directory/project needs to be removed from the command. See dotnet documentation from more information.

This project requires dotnet core, see image used in Jenkinsfile for specific requirements.

dotnet build .\src\

Testing

dotnet test .\src\

For acceptance testing, see Acceptance Testing

For running this locally, see Comamnd line usage

Deployment

Project Pinja.AzureSubscriptionCleaner.AzureFunctions can be deployed to Azure as Azure Function.

Create copy from developer-settings.example.json as developer-settings.json with your own values and execute deployment\Prepare-Environment.ps1

The function app also needs to be able to delete other resource groups. This can be done by giving the function app Contributor access to the subscription. This is not done as part of the CI progress.

For details, see deployment\Prepare-Environment.ps1

License

The MIT License (MIT)

About

Performs cleaning operations for Azure Subscription. This is used to removed unused items from development subscription.

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •