Enforce Cost limit per subscription or tenant to not exceed the allowed amount per month

Vasanth Rao Jadav 41 Reputation points
2024-05-16T19:38:59.1666667+00:00
I wanted to enforce Cost limit per sub or tenant, and NOT to exceed the allowed amount per month.

Ex: I want to allocate monthly $20 for doing POCs, if amount exceed, it supposed to NOT allow to create new instances and already existing instances supposed to be suspended if its involves cost.

How to achieve this, please lay out the steps.

Note: I tried cost alter where its giving me email alter if its exceeding the limit, but this is not a viable option for me. Its must suspended all the existing instances which involves cost associated. 

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,221 questions
0 comments No comments
{count} votes

Accepted answer
  1. Dan Rios 1,655 Reputation points MVP
    2024-05-16T20:15:26.1+00:00

    There is no native way you can implement this out the box unfortunately.

    Only Azure subscriptions like visual studio will enforce a spending limit. Pay as you go and most Azure subscriptions won’t allow this feature and so you can’t enforce a limit.

    You can however have automation help you out. You can set to trigger a logic app, azure runbook script or Azure function to help stop (or delete, since you do not wish to exceed the budget amount). When the budget alert is triggered it can then run the script to stop all resources (or try and delete them).

    there are some examples online already such as:

    https://github.com/microsoft/budget-control-sample

    Hopefully this helps you out. Please feel free to mark as accepted answer so others can benefit.


0 additional answers

Sort by: Most helpful