Microsoft introduced Azure Budgets as a means to help companies plan for and drive organizational accountability. While many companies view budget enforcement from a traditional perspective such as alerts, currently Azure did not give you more direct options such as shutting down virtual machines (VMs). Using Budgets makes Azure cost management easy.
While these features are not out of the box, Azure Budgets does offer integration with Azure Action Groups. Action Groups provide a means to trigger an orchestrated set of actions resulting from a budget event. Such actions can be turning off machines when a threshold takes place (in this case when the budget is exceeded by a certain amount), for example. The action groups in term can then execute a PowerShell script (within an automation account) to perform the cost savings action.
It should be noted: this course of action does not need to be applied to all VMs. For example, the
shutdown sequence of VMs to keep within budget can be directed to machines: