Azure Cost Management: How to Not Wake Up to a €400 Bill
You spin up a test VM for an afternoon, forget about it, and three weeks later Azure sends you an invoice that reads like a phone number. This happens to almost everyone at least once, and it’s completely avoidable with about ten minutes of setup you’ll do once and forget about, in a good way this time.
Where the surprises usually come from
- VMs left running because stopping them in the Azure Portal doesn’t always mean deallocated, a stopped-but-not-deallocated VM still bills you
- Unattached disks from VMs you already deleted, the disk itself doesn’t get removed automatically
- Public IP addresses reserved but not attached to anything, still billed hourly
- Egress traffic, outbound data costs money even if the compute itself is cheap
- Test resources from a tutorial (yes, possibly one of the ones on this blog) that never got cleaned up
Set a budget (actually do this one)
In the Azure Portal, search for Cost Management, open your subscription, and go to Budgets. Create a monthly budget with a number that would make you look twice if you hit it, even if you don’t expect to. Add an alert at 50%, 80%, and 100% of that budget, sent to your email.
This doesn’t stop anything automatically, Azure won’t shut your resources off for you, but you’ll get an email while the bill is still small instead of finding out at the end of the month.
Cost analysis: find the actual culprit
Still inside Cost Management, open Cost Analysis and group by Resource or Resource Group. This is where you actually see which specific VM, disk, or service is eating your budget, instead of just knowing the total went up. Nine times out of ten it’s one forgotten resource, not a slow bleed across everything.
Group by Resource Group first if you have more than a handful of resources. It’s much faster to spot “oh, that whole test environment is still running” than to scroll through individual resources one at a time.
The habit that saves you the most
Tag everything when you create it, even a simple env:test tag. Then once a month, filter Cost Analysis by that tag and actually delete what you don’t need anymore. It takes five minutes and it’s the single habit that prevents most of the surprise bills people post about online.
Let Azure Advisor tell you what’s wasted
Search for Advisor in the portal and open the Cost tab. This scans your actual usage patterns and flags specific waste: VMs that have been idle for weeks, disks with no VM attached, or resources sized well above what they’re actually using. It’s not just theory, each recommendation shows the estimated monthly saving if you act on it, and most of the time it’s pointing at exactly the kind of forgotten resource from the list above.
Reserved instances and savings plans, once you’re past testing
Everything above is about not wasting money on things you don’t need. This part is about paying less for things you do need long-term. If a VM is going to run continuously for a year or more (not a test box, an actual production workload), Reserved Instances or an Azure Savings Plan can cut compute costs meaningfully compared to pay-as-you-go pricing, in exchange for committing to a 1 or 3-year term. Not something to reach for while learning, since it locks you into that VM size and region, but worth knowing exists for when a homelab experiment turns into something you actually depend on.
A real example
The SQL Database from an earlier post in this series is a good case study: created for a test, left running on the Standard tier, forgotten for two weeks. On the DTU-based Standard S0 tier that’s a genuinely small bill, but swap that for a Premium tier database or a beefier VM and “forgotten for two weeks” turns into exactly the kind of invoice this post opened with. The budget alert from earlier would have caught it at 50% before it became a surprise, which is the entire reason it’s worth the ten minutes to set up.
Related reading
- Just getting started with Azure? here’s what AZ-900 actually covers
- Spinning up test VMs to experiment? this is exactly the kind of resource that turns into a surprise bill if you forget to clean it up


