DEV Community

HosheBartar
HosheBartar

Posted on Originally published at hoshebartar.com

Which Azure budget needs action? A pace check you can do by hand

Azure budget alerts tell you when a budget crosses a share of its amount: 50%, 80%, 100%. That is useful, but a 50% alert on day 25 of the month and a 50% alert on day 6 mean very different things. The second one is a problem; the first one is fine.

Here is a simple pace check you can do by hand for any budget, and then how we automated it.

1. List your budgets and their scopes

In the Azure portal, open Cost Management > Budgets. A budget is set on a scope (a subscription, a resource group, a management group or a billing scope), has an amount and a reset period, and sends alerts on actual or forecasted cost at the thresholds you set. A budget never stops anything: it measures and notifies.

Write down, for each budget: the scope, the amount, the period and the spend so far this period.

2. Compute two shares

For each budget:

  • Share used = spend so far / amount
  • Share of the period elapsed = days gone / days in the period

Example: a monthly budget of 1,000, day 12 of 30, spend so far 550.

  • Share used: 55%
  • Share of the period elapsed: 40%

The budget is not over, and it may not even have fired its first alert yet if you set it at 80%. But it is spending faster than the calendar: at an even pace it would be at 400, not 550.

3. Grade them

A grading that is easy to explain to a team:

  • Over: 100% or more of the amount spent.
  • At risk: 50% or more spent, but not all.
  • On track: less than 50% spent.
  • Ahead of pace: share used larger than share of the period elapsed, while the amount is not yet spent.

Sort the list with the worst first, and you know which budget to look at.

4. Keep the traps in mind

  • Cost arrives late. Azure cost data is usually a day or two behind, so "spend so far" is spend up to a day or two ago.
  • Currencies. If your subscriptions are billed in different currencies, never add the amounts together without an exchange rate you trust.
  • Do not prorate the amount. Compare the full amount with the spend so far; the pace check is a separate signal, not a forecast.

The automated way

I build CostGuard, an Azure cost tool for small SaaS teams on Azure Marketplace, and its Budgets page does this check for every budget. (Disclosure: I build CostGuard, so take this part as the maker's description.)

CostGuard's Budgets list for a sample workspace: each budget with its scope, period, amount, the usage of this period and its grade.

  • Each budget covers the whole workspace, a subscription, a resource group or a service, per day, week, month, quarter or year (calendar periods in UTC).
  • The This period column shows the spend, a bar of the share used with a mark at the share of the period elapsed, what remains or by how much it is over, and the day of the period ("Day 12 of 30").
  • Every budget is graded over, at risk or on track with the 50% and 100% rule above, and "Ahead of the period's pace" is shown when it applies. The list puts the most urgent first.
  • When no figure can be stated (no cost import yet, cost only in another currency), the row says why instead of showing zero.

Three rows of the This period column: the spend, a bar of the share used with a mark at the share of the period elapsed, the share used and the day of the period.

CostGuard only reads your Azure data with the Reader role; it never changes anything in Azure.

Honest limits

  • Email alerts run against one budget only: the enabled monthly budget of the whole workspace. Every other budget shows its usage on the page and raises no alert.
  • "Ahead of the period's pace" compares two shares; it is not a forecast.
  • Each budget has one currency, and nothing is converted: cost in another currency is named, not added.
  • Budgets are on the Starter plan and up (5 on Starter, 20 on Growth, unlimited on Pro). There is a Free plan on Azure Marketplace, where the page shows a labelled sample.

The whole page, section by section: Budgets: see which budget needs action

Top comments (0)