Cost Management – Budget and Scope in Azure

Azure subscription has a feature called Cost Management. Cost Management has capabilities of cost analysis, cost alerts (in preview), and budgets.

This post will cover, how to create budgets, define scopes, and apply filters in Azure Cost Management.

Budgets are helpful to notify when a resource group or a subscription uses more than the allocated amount for a given period. Once a budget term ends, then the same budget will be assigned for the next cycle. Budgets reset itself at the end of a period, for example – monthly, quarterly, or annually, and the same amount would allocate when the chosen date is a future expiration date.

Setting budgets are important when —

  • You do not know what would be the future usage or expanses of services
  • You start some costly services, but not going to use for a longer time
  • You forgot to stop some expensive services

Budgets in Azure Portal

Creating a budget in the Azure portal is quite simple and can be done with some details about the budget and configuring an alert.

Steps need to be performed to create a budget-

  • Login to Azure Portal
  • Select a Resource group, for example – demo
  • Go to the Cost Management section and click on Budgets
  • Click on Add and enter the required details.
  • Click on Create
Create Budget
Set Alerts

Once you would create a budget first time, it would show in the budget screen, but you may need to wait for 12 to 14 hours to get calculated the first time as per Microsoft. I have created some budgets to show calculated and not calculated ones.

Partial Calculated Budgets
Calculated Budgets

As budgets are configured at the demo resource group scope so a notification will get trigger once the budget percentage allocated is exhausted by the resource group.

Change Scope for Budgets

The previous budgets have created for a resource group, demo, so the scope for budget estimation is limited only for the resource group. If you need to change this scope for a budget, then that can be done from the scope option.

Steps need to be performed to change the scope

  • Go to budgets section in resource group
  • Click on the scope icon
  • Follow the navigation pane on the right.
  • Click on Select this subscription
  • Provide details to the budget and set alerts
  • Click on Create

You will find that now the scope has changed to the subscription level, and you can create budgets in the same way as we have seen in the Create Budget section. Let’s create one more budget at the subscription level and verify the created budget.

All Budgets

Add Filters to Budget

We can define scopes even at the services level for a subscription or a resource group by using filters. The filters are available to create budgets at a very granular level and having a lot of options to fulfill requirements.

The Filters can be added at the subscription level or resource group level either while creating a budget or editing a budget. Let’s edit a budget and apply the azure services filter.

Steps need to be performed to add filter

  • Click on a budget from Budgets screen
  • Click on Edit budget
  • Click on the filter from the scope section
  • Select Service Name from the first dropdown, and select services next dropdown.
  • Click on next to change Alerts if anything
  • Save the Budget.
  • Verify the chart changes.
Add Filters
Apply Filter
Cost Graph

This graph may vary on the services selected while applying the filter.

I hope this will help while working on the Azure-based application.

Happy Learning 🙂

Leave a Reply

Up ↑

%d bloggers like this: