Azure cost management: budgets, Advisor, savings

Azure cost management is the everyday work of knowing what you spend, why you spend it and what to change. Cost Management shows and forecasts the bill, budgets warn you before it grows, and Advisor points out waste, while reservations, savings plans, Spot and Azure Hybrid Benefit bring down the price of whatever you keep running.

In most companies the cloud bill belongs to “someone else” right up until it doubles, and an admin who can answer “what costs money, and what can we switch off?” in ten minutes becomes very popular very quickly.

In the lab you’ll break this course’s spend down by resource group, add a budget that emails you and check Advisor. After pricing some real savings options, you’ll go hunting for the two kinds of silent waste that every subscription has.

TimeYou needCostBy the end you can
About 40 minutesThe CLI, ag-saat-email from Lesson 31No cost for the queries and budget; the orphan disk and IP in Break It cost a fraction of a cent for a few minutesAnalyse costs, set budgets with actions, read Advisor, compare savings options, and find orphaned resources

What it is, in one line

Azure cost management means seeing, forecasting and cutting your Azure bill with Cost Management, budgets, Advisor and pricing options.

In Simple Words

The household electricity bill

When the electricity bill doubles, you walk round the house to find out who left the heater on or whether the old fridge in the garage is still plugged in. That walk is cost analysis, and the old fridge is an orphaned resource.

A note on the fridge door saying “we’ve used 80% of this month’s budget” is a budget alert, which warns you but doesn’t switch anything off.

Paying a year in advance to get a cheaper rate is a reservation, and it only saves you money if you use that electricity all year round.

Engineer's View

The cost toolbox, with real prices

  • Cost analysis: shows actual cost (as billed) and amortized cost (reservations spread over their term), grouped by resource group, service, tag or meter. Data usually turns up within a day, but it can lag by up to 72 hours.
  • Budgets: monthly, quarterly or yearly amounts at subscription, resource group or management group scope, which alert on actual or forecasted spend. They notify you by email and through action groups, but they never stop resources on their own.
  • Advisor: gives cost recommendations like right-sizing or shutting down underused VMs, buying reservations and deleting idle resources.
  • Exports and Resource Graph: scheduled cost exports to storage for your reports, and inventory queries to find orphans.
Option for one D2s_v5 Linux VM, Central IndiaCostSaving vs pay-as-you-go
Pay-as-you-go, USD 0.101/hourUSD 73.73 a monthNone
1-year reservation, USD 546USD 45.50 a month38.3%
3-year reservation, USD 1,048USD 29.11 a month60.5%
Spot, USD 0.018665/hour (can be evicted)USD 13.63 a month81.5%
Windows on the same size, USD 0.193/hourUSD 140.89 a monthAzure Hybrid Benefit pays the Linux rate: 47.7% less

Prices come from the Azure Retail Prices API on 21 Oct 2026, with months counted as 730 hours. Your own agreement may differ.

  • Savings plans for compute: you commit to an hourly spend for 1 or 3 years across VM sizes and regions. They’re more flexible than reservations, though the discount is usually a little smaller.

How it works, step by step

This is how a monthly budget alert gets to you:

Azure cost management: how a budget alert reaches you
  1. Each service meters its usage, which then gets rated into cost, usually within a day.
  2. Cost Management adds that cost to the budget’s scope and works out the actual and forecast spend.
  3. Budget evaluations run several times a day and compare the numbers with your thresholds.
  4. When a threshold is crossed, the budget sends its email and calls its action groups.
  5. An action group can run a runbook or a Logic App to do something, but the budget itself never stops anything.

That delay is important, because a mistake made at 10:00 might not show up in the budget until the next day. Budgets are good at catching slow leaks, and for fast ones you need cost anomaly alerts and good guardrails.

Azure cost management: pay-as-you-go, reservation and Spot prices compared

The biggest savings nearly always come from the boring list. Switch off what’s idle, delete what’s orphaned and right-size what’s too big, and only after that buy reservations for whatever is still running 24/7.

Hands-on lab: Azure cost management for the course subscription

Before you run any command, double-check it

Read every command twice before you press Enter. Check the target: the system or account, the IDs, the names and the sizes. These commands are for learning and were tested in our lab, not on your system. At work, run the read-only list commands first, follow your change process, make sure a backup exists, and ask a second person to check anything that changes or deletes data. You run them at your own risk.

Load your subscription ID:

$sub = az account show --query id -o tsv

1See this month’s cost by resource group

Run the Cost Management query API, using the same pattern as the cost-by-lesson query in Lesson 4:

$q = @{
  type      = 'ActualCost'
  timeframe = 'MonthToDate'
  dataset   = @{
    granularity = 'None'
    aggregation = @{ totalCost = @{ name = 'Cost'; function = 'Sum' } }
    grouping    = @(@{ type = 'Dimension'; name = 'ResourceGroupName' })
  }
}
$q | ConvertTo-Json -Depth 6 | Set-Content -Path C:\azure-lab\cost-by-rg.json
$r = az rest --method post --url "https://management.azure.com/subscriptions/$sub/providers/Microsoft.CostManagement/query?api-version=2023-03-01" --body '@C:\azure-lab\cost-by-rg.json' | ConvertFrom-Json
$r.properties.rows | Sort-Object { $_[0] } -Descending | ForEach-Object { '{0,-14} {1,8:N2} {2}' -f $_[1], $_[0], $_[2] }

You should see something like this:

rg-saat-vms        1.84 USD
rg-saat-core       0.97 USD
rg-saat-data       0.06 USD

Your numbers will be different. Don’t worry if a resource group you’ve deleted still shows cost, since it was running earlier this month.

2Add a budget that alerts your action group

Here’s a USD 2 monthly budget on rg-saat-vms that alerts at 80% actual and 100% forecast:

$ag = az monitor action-group show --resource-group rg-saat-core --name ag-saat-email --query id -o tsv
$start = (Get-Date -Day 1).ToString('yyyy-MM-01T00:00:00Z')
$b = @{ properties = @{
  category = 'Cost'; amount = 2; timeGrain = 'Monthly'
  timePeriod = @{ startDate = $start }
  notifications = @{
    actual80   = @{ enabled = $true; operator = 'GreaterThan'; threshold = 80;  thresholdType = 'Actual';     contactGroups = @($ag) }
    forecast100 = @{ enabled = $true; operator = 'GreaterThan'; threshold = 100; thresholdType = 'Forecasted'; contactGroups = @($ag) }
  } } }
$b | ConvertTo-Json -Depth 6 | Set-Content -Path C:\azure-lab\budget-vms.json
az rest --method put --url "https://management.azure.com/subscriptions/$sub/resourceGroups/rg-saat-vms/providers/Microsoft.Consumption/budgets/budget-rg-vms?api-version=2023-11-01" --body '@C:\azure-lab\budget-vms.json' --query "{name:name, amount:properties.amount, grain:properties.timeGrain}" -o table

You should see this:

Name           Amount    Grain
-------------  --------  -------
budget-rg-vms  2.0       Monthly

3Ask Advisor for cost recommendations

Run this:

az advisor recommendation list --category Cost --query "[].{impact:impact, problem:shortDescription.problem, resource:impactedValue}" -o table

You might see nothing at all, or something like this:

Impact    Problem                                                      Resource
--------  -----------------------------------------------------------  ----------
Medium    Right-size or shutdown underutilized virtual machines        web01

Advisor needs a few days of usage data, and your lab VMs are off most of the time, so an empty list is quite normal here. In a real subscription, though, this list is the first place you should look each month.

4Price the savings options yourself

Check the reservation and Spot prices for D2s_v5 in Central India:

$f = "serviceName eq 'Virtual Machines' and armRegionName eq 'centralindia' and armSkuName eq 'Standard_D2s_v5'"
$u = 'https://prices.azure.com/api/retail/prices?$filter=' + [uri]::EscapeDataString($f)
(Invoke-RestMethod -Uri $u).Items | Where-Object { $_.productName -notlike '*Windows*' } | Select-Object skuName, type, reservationTerm, retailPrice | Format-Table -AutoSize

You should see something like this:

skuName                     type        reservationTerm retailPrice
-------                     ----        --------------- -----------
Standard_D2s_v5 Spot        Consumption                    0.018665
Standard_D2s_v5 Low Priority Consumption                   0.0202
Standard_D2s_v5             Consumption                    0.101
Standard_D2s_v5             Reservation 1 Year                  546
Standard_D2s_v5             Reservation 3 Years                1048

Reservation prices are the total for the whole term, not an hourly rate, and that’s how the table in the Engineer’s View arrives at savings of 38.3% and 60.5%.

Make those numbers into a habit. Once a month, give Azure cost management 20 minutes: open Cost analysis grouped by resource group, compare it with last month, and note down the top three changes and the reason for each. After that, go through Advisor and the orphan query from Break It.

Teams that do this every month rarely end up in a “why has the bill doubled?” meeting, because they spot the change while it’s still small.

Azure cost management lab: cost by resource group, budget and prices
Cost by resource group, a budget, and real reservation prices.

✅ Checkpoint: You know which resource groups cost the most, budget-rg-vms emails ag-saat-email, and you can price reservations and Spot yourself.

Break It, Then Fix It

Neither of these gives you an error; they just cost money quietly.

1Break it: the leftovers nobody remembers

Create the things a deleted VM often leaves behind, a detached disk and a public IP that’s attached to nothing:

az disk create --resource-group rg-saat-core --name disk-orphan --size-gb 32 --sku Premium_LRS --tags course=saatvedha-azure lesson=44 -o none
az network public-ip create --resource-group rg-saat-core --name pip-orphan --sku Standard --tags course=saatvedha-azure lesson=44 -o none
az graph query -q "Resources | where (type =~ 'microsoft.compute/disks' and properties.diskState =~ 'Unattached') or (type =~ 'microsoft.network/publicipaddresses' and isnull(properties.ipConfiguration)) | project name, type, resourceGroup" --query "data[].{name:name, type:type, group:resourceGroup}" -o table

You should see something like this:

Name         Type                                     Group
-----------  ---------------------------------------  ------------
disk-orphan  microsoft.compute/disks                  rg-saat-core
pip-orphan   microsoft.network/publicipaddresses      rg-saat-core

Neither of these shows up anywhere unless you go looking. A 32 GiB Premium disk and a static public IP keep billing every hour until someone deletes them, and in real subscriptions this query often comes back with hundreds of rows after a migration.

To fix it, first make sure nobody needs them by checking the tags, the owners and the recent Activity log, and then delete them:

az disk delete --resource-group rg-saat-core --name disk-orphan --yes
az network public-ip delete --resource-group rg-saat-core --name pip-orphan
az graph query -q "Resources | where (type =~ 'microsoft.compute/disks' and properties.diskState =~ 'Unattached') or (type =~ 'microsoft.network/publicipaddresses' and isnull(properties.ipConfiguration)) | project name, type, resourceGroup" --query "data[].{name:name, type:type, group:resourceGroup}" -o table

The last command shouldn’t print anything.

2Break it: “the budget will stop it”

A manager tells you, “We set a USD 2 budget on rg-saat-vms, so we can’t overspend.” Start web01 and win01, leave them running overnight, and the budget will send its emails at 80% and 100%, but nothing gets stopped, because budgets only alert and don’t act.

To fix it, give the budget an action. In the portal, open ag-saat-email, go to Actions and add an Automation Runbook action that runs Stop-LabVMs from Lesson 43 on aa-saat, then save. Now the forecast-100% alert stops your lab VMs as well as emailing you.

Azure cost management budget action group with an Automation runbook action
ag-saat-email now runs Stop-LabVMs as well as sending the email.

Keep the budget and the action. You can delete the files the lab created if you want to, as there are no secrets in them.

Azure cost management waste: orphaned disks and IPs, budgets without actions
Orphans found with Resource Graph, and a budget that needed an action.

✅ Checkpoint: You found and removed two orphans with Resource Graph, and your budget now triggers a runbook instead of only an email.

This happened at work

The migration that left 600 disks behind

A media company moved its render farm from one VNet design to another, rebuilding 400 VMs from images, and the project finished on time. Three months on, though, the monthly bill was 40% higher than it had been before the migration.

Someone grouped Cost analysis by service and saw that it was Storage that had grown, not Compute. A Resource Graph query then turned up 612 unattached Premium disks and 150 unused public IPs. The old VMs had been deleted, but nobody had deleted their disks and IPs.

What they changed: the decommission runbook now deletes the disks, NICs and IPs along with the VM, and a weekly report lists anything that’s been Unattached for more than 7 days. Policy now requires an owner tag on every resource, and each team’s budget calls a runbook that tags offenders for review.

Common mistakes and troubleshooting

MistakeWhat you seeWhat to do
Expecting budgets to stop resourcesAlerts arrive; spend continuesAdd an action group with a runbook or Logic App.
Deleting VMs without their disks and IPsStorage and IP costs growQuery weekly for Unattached disks and unused IPs.
Buying reservations firstPaying for VMs that should be offClean up and right-size first, then reserve.
Running Windows without Hybrid Benefit when licensedPaying for Windows twiceApply Azure Hybrid Benefit where you have licences.
Untagged resourcesNobody owns the costRequire owner and cost-centre tags by policy.
Reading today’s cost as finalNumbers jump tomorrowAllow for 24 to 72 hours of delay.

Interview questions

Click a question to open it. Each one is worded the way an interviewer would ask it, and underneath you’ll find why they ask it and one way you could answer in your own words.

Fresher level

1. What does Azure Cost Management do?

Why they ask this: To check the basic concept.

How you might answer: It shows, analyses and forecasts what you spend in Azure by scope, service, resource group and tag, and it gives you budgets, alerts and exports.

2. Do budgets stop resources?

Why they ask this: A common misunderstanding.

How you might answer: No, they don’t. Budgets send alerts by email and through action groups, and if you want something to happen automatically, the action group has to run a runbook, a Function or a Logic App.

3. What is a reservation?

Why they ask this: A pricing basics question.

How you might answer: It’s a 1 or 3-year commitment to a VM size or service in a region, and in return you get a lower price. It only saves money if the resource actually runs most of the time.

2–5 years experience

4. How do you find waste in a subscription?

Why they ask this: They want a method.

How you might answer: I’d look at Cost analysis by service and resource group for trends, then Advisor’s cost recommendations. Resource Graph finds unattached disks, unused IPs and idle gateways, and metrics show underused VMs. Then I clean up, right-size and schedule shutdowns, and only after that do I reserve.

5. Reservation or savings plan: how do you choose?

Why they ask this: They want trade-offs.

How you might answer: Reservations give you the deepest discount but for a fixed size and region. Savings plans give a bit less, but they apply across sizes, series and regions. I’d put stable, predictable workloads on reservations and use savings plans where the sizes keep changing.

6. When would you use Spot VMs?

Why they ask this: They want risk awareness.

How you might answer: For work that can be interrupted, like batch jobs, rendering, CI agents and test environments. Spot VMs can be evicted at short notice, so the app has to cope with losing a VM.

Senior level

7. How would you set up cost governance for a company?

Why they ask this: They want a framework.

How you might answer: I’d start with management group budgets and use policy to require owner and cost centre tags. Then monthly reviews with Advisor and Cost Management, showback reports for each team, automated cleanup of orphans, and a reservation and savings plan strategy that FinOps owns.

8. How do you handle a cost spike found on Monday?

Why they ask this: They want incident thinking.

How you might answer: I’d use Cost analysis by day and by resource to find when it started, and check the Activity log for what changed at that time. Then contain it by scaling down, stopping or deleting, and afterwards add a guardrail, whether that’s a policy, a budget action or an anomaly alert.

9. Actual vs amortized cost: when do you use each?

Why they ask this: A detail FinOps people check.

How you might answer: Actual shows purchases when they’re billed, so a reservation shows up as one big charge. Amortized spreads that over the term, which is better when you’re showing teams what they use each month.

Quick quiz

Q1. What does a budget do when its threshold is crossed?

  1. Stops VMs
  2. Sends alerts and calls action groups
  3. Deletes resources
  4. Nothing
Show answer

B — Budgets notify; actions need an action group.

Q2. 1-year reservation for D2s_v5 Linux in Central India costs USD 546. Monthly equivalent?

  1. USD 73.73
  2. USD 45.50
  3. USD 29.11
  4. USD 13.63
Show answer

B — 546 divided by 12.

Q3. Which tool finds unattached disks across subscriptions fast?

  1. Boot diagnostics
  2. Resource Graph
  3. Bastion
  4. Key Vault
Show answer

B — A Resource Graph query lists them.

Q4. Spot VMs are best for:

  1. Domain controllers
  2. Work that can be interrupted
  3. Databases
  4. Firewalls
Show answer

B — Spot can be evicted.

Q5. Azure Hybrid Benefit for Windows means:

  1. No Windows licence needed
  2. Paying the Linux rate with your own Windows licence
  3. A reservation
  4. Spot pricing
Show answer

B — You bring licences you already own.

Quick recap

You can now explain the bill, warn people before it grows, and cut it safely.

  • Cost analysis: actual vs amortized, grouped by what matters.
  • Budgets only alert; action groups are what make them act.
  • Find orphans with Resource Graph, and delete them with care.
  • Reserve only what runs all the time, and use Spot for work that can be interrupted.
  • Clean up and right-size before you commit.

Next lesson

Lesson 45: Hub-and-spoke network design → You design a hub VNet with shared services and spokes for workloads, the layout most enterprises use.

Further reading: Azure cost management

Want to go deeper into Azure cost management? See Microsoft’s Cost Management overview and Advisor cost recommendations. You can also see the full plan for this course on the Azure Cloud Administration course page.

Scroll to Top

This website uses cookies

We use a few cookies to keep this site working. If you allow it, we also use Google Analytics to count visits so we can improve our lessons. You can accept all, deny the optional ones, or choose what to allow.