How to nuke whole azure account when spending is over a limit?

Viewed 325

Azure has no spending limit on Pay As You Go plan and has no intention of implementing it (at least not in this century). They only have a cost alerts alerts that can do some actions (Automation runbooks looks promising).

How should I go about nuking everything (from cognitive services through websites to storage/db) when I am over a specific budget?

I am looking for a simple and fireproof way (with low false positives if possible, but no false negative in every case).

1 Answers

Set up your budget as follows: https://docs.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-acm-create-budgets

Create a webhook powershell script to shutdown your resources, by managing actions: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/action-groups

The powershell script will depend on what resources you have.

Note the costs are available within 8 to 24 hours, and the budget is evaluated every 12 to 14 hours. So you could hit your budget limit and continue running for 36 hours.

Related