Controlling Spending with Budgets and Cost Alerts
Microsoft Cost Management shows and forecasts spending. This lesson explains cost analysis, budgets and the different kinds of cost alerts.
Learning outcomes
After completing this lesson, you will be able to:
- Describe cost analysis views, including grouping by tag and amortized cost.
- Explain budgets, their alert conditions and how action groups automate a response.
- Distinguish between budget, anomaly and other cost alerts.
Cost analysis
Cost analysis shows accumulated and forecast costs for a scope (management group, subscription, resource group or billing scope). Views can be grouped and filtered by service, resource, resource group, location, meter or tag, switched between actual cost (purchases shown when they occur) and amortized cost (reservation purchases spread over their term), and saved or exported to a storage account on a schedule. Access is controlled by Azure roles such as Cost Management Reader and Cost Management Contributor, or by billing roles.
Reading cost analysis
Budgets
A budget sets an amount for a scope over a reset period (monthly, quarterly or annually) with a start and expiry date, optionally filtered by resource group, service or tag. It has alert conditions at percentages of the budget, each based on actual cost (spending has happened) or forecasted cost (spending is predicted to reach the threshold), for example forecast at 90% and actual at 100%. Each condition emails recipients and can trigger an action group.
A budget never stops resources or spending by itself. To act automatically, connect the alert to an action group that runs an Azure Automation runbook, Logic App or function that, for example, shuts down development VMs. Cost data is updated several times a day, so budget evaluation has some delay. Budgets are created in the portal, with az consumption budget create, or in templates.
The following diagram shows a monthly budget's two alert conditions, one that notifies and one that acts.

Designing a budget
Other cost alerts
Cost Management offers other alert types besides budget alerts. The following table summarizes them.
| Alert | Purpose |
|---|---|
| Budget alert | Spending or forecast reaches a percentage of a budget |
| Anomaly alert | Daily cost changes unexpectedly for a subscription, detected by machine learning |
| Scheduled alert | Emails a saved cost view on a schedule |
| Reservation utilization alert | Reservations are underused |
| Credit and department quota alerts | Enterprise Agreement credit or department spending thresholds |
Kinds of cost alert
Stopping a runaway sandbox
A sandbox subscription has a monthly allowance of 2,000 US dollars. Administrators want an email when the forecast reaches 80% of the allowance, and all VMs in the subscription must be deallocated automatically when actual spending reaches 100%. What should you configure?
Create a monthly budget of 2,000 on the subscription with two alert conditions: Forecasted at 80% with email recipients, and Actual at 100% linked to an action group that runs an Automation runbook to deallocate the VMs. The budget alone would only notify; an anomaly alert reacts to unusual changes, not to a fixed threshold.
Does a budget stop resources when spending reaches 100%?
Show answer
No. A budget only alerts; stopping resources needs an action group that runs automation such as a runbook.
Exam Tips
Remember for the exam
- Budgets alert; they never stop resources unless an action group runs automation.
- Alert before spending happens: a forecasted cost condition.
- Budgets can be scoped to management groups, subscriptions and resource groups, and filtered by tag.
- Unexpected spikes: cost anomaly alerts.