Azure costs: what drives them, the pricing calculator, Cost Management and tags
Why this matters
Paying only for what you use (lesson 2) cuts both ways. Nobody signs a purchase order before a developer creates a large virtual machine, so nobody notices the bill until it arrives. The surprises are usually the same: a machine shut down from inside Windows that kept charging, disks left behind after a project ended, data copied between regions every hour, or a workload priced in one region and deployed in another. None of these is a fault in Azure. Each is a cost driver that someone did not know about.
A manager needs this lesson to ask the right question: an estimate before deployment, or a report of what was actually spent? A salesperson needs it to build a credible quote for a customer who has no Azure subscription yet. A junior administrator needs it to set a budget alert, label resources so finance can split the bill by department, and clean up properly when testing ends. Without it, cloud spending is a monthly argument instead of a managed number.
The lesson
What drives the cost of an Azure resource
Azure publishes rates, and the bill is those rates multiplied by what you use. The factors below change one side or the other. This lesson gives no figures, because prices change and vary by offer; learn what moves them instead.
The resource type and its settings. Each service has its own pricing, and the choices made when creating a resource set its rate: the VM size, the storage access tier (lesson 9), the database tier, the performance level. Two storage accounts holding the same data cost different amounts if one keeps it in the hot tier and the other in archive.
Consumption. Most services bill by use: hours a VM runs, gigabytes stored, transactions made. When an App Service plan scales out from two instances to ten for a sales event, cost rises only while the extra instances run and falls when it scales back in. Scaling out and scaling up both add charges for as long as the capacity is used.
VM state. This catches many people.
- A VM shut down from inside the guest operating system is still allocated to Azure hardware, so its compute charges continue.
- A VM stopped and deallocated from the portal, CLI or another Azure tool releases its compute, so compute hours (and any licence charged with them) stop.
- Even deallocated, the VM's managed disks still exist and are billed for storage.
Leftover resources. Disks, public IP addresses and similar resources are billed in their own right. Delete the VMs but leave those behind and the charges continue. Azure does not tidy up on its own. Putting resources that share a lifecycle into one resource group (lesson 6) lets a team delete the whole set with a single action when testing ends.
Region. Many services cost different amounts in different regions, because running datacenters costs different amounts in different places. The same VM size can have two hourly rates in two regions.
Data transfer (bandwidth). Data moving into Azure is generally free. Data leaving Azure is charged, and so is data moving between Azure regions. A design that copies data to another region every hour adds transfer charges. A workload that mostly uploads pays little for bandwidth.
How you buy. The same compute can cost different amounts depending on the purchasing option.
| Option | How it saves | Best fit |
|---|---|---|
| Pay-as-you-go | No saving; full flexibility | Unpredictable or short-lived use |
| Azure Reserved VM Instances | Discount for committing to a VM type in a region for one or three years | Steady, always-on workloads |
| Azure savings plan for compute | Discount for committing to a fixed hourly spend, applied across eligible services, sizes and regions | Steady spend whose shape changes |
| Azure Spot Virtual Machines | Deep discount on spare capacity that Azure can evict | Interruptible batch work, never production that must stay up |
| Azure Hybrid Benefit | Reuse existing Windows Server and SQL Server licences with active Software Assurance | Companies moving licensed servers to Azure |
Subscription and offer type. Different offers, such as an Enterprise Agreement or pay-as-you-go, can carry different prices and discounts for the same services. Neither removes charges for outbound data. An Azure free account gives a starting credit to spend in an initial period, some popular services free for a limited time, and a set of services that are always free within limits. It is not unlimited, and use beyond the free amounts must be paid for.
Azure Marketplace. A third-party solution from Azure Marketplace, such as a firewall appliance on a VM, can carry the vendor's own software charge, billed through Azure, on top of the Azure infrastructure it runs on. The VM is still charged.
What does not change the price: the name of a resource group, the number of tags, or which management group a subscription sits in. These are free organising features.
Exploring the Azure pricing calculator
The Azure pricing calculator is a public web tool that estimates the cost of Azure services before anything is deployed.
- It can be used without an Azure subscription. A start-up or a consultant building a quote for a client who has not signed up can use it straight away. Signing in only adds the ability to save estimates.
- You add products to an estimate (VMs, a database, storage) and choose settings for each: region, size or tier, quantity, hours per month, redundancy, and purchasing option. Region and size both change the price. The name of the estimate and the order of its items do not.
- To compare regions, build the same set of services twice with a different region selected and set the two estimates side by side.
- An estimate can be exported as a spreadsheet or shared through a link, so a finance team can review the same figures.
Two limits are worth knowing. The calculator only prices services: it cannot deploy an estimate or turn it into a budget. And an estimate is only as good as its inputs. If real usage turns out higher, with more hours, more transactions or more outbound data, the first invoice will be higher than the estimate.
Microsoft Cost Management
The pricing calculator looks forward. Microsoft Cost Management looks at what is actually happening. It analyses, tracks and budgets real spending on resources that already exist.
- Cost analysis shows historical spending and lets you group and filter it by service, resource group, location or tag. "How much did we actually spend last month, by service?" is a cost analysis question. It works at several scopes, including billing accounts, management groups, subscriptions and single resource groups.
- Forecasts in cost analysis project spending to the end of the period from current usage, so an analyst can see a likely overrun before the month ends.
- Budgets set an amount for a scope. Alert conditions send a notification, such as an email, when actual or forecast spending reaches a chosen percentage of that amount, for example 80 percent. By default a budget only alerts. Resources keep running past the budget, and nothing is stopped or blocked unless the team adds its own automation, for example through an action group.
- Anomaly alerts watch the spending pattern and notify people when daily costs rise or fall unexpectedly, even when no budget threshold has been crossed.
- Exports write cost and usage data as files to a storage account on a schedule, ready for the team's own reporting tools.
- Advisor cost recommendations, such as resizing or shutting down underused VMs, appear in Cost Management, but they are produced by Azure Advisor (lesson 16).
Cost Management does not estimate services you have not deployed (that is the pricing calculator), does not block expensive resource types (that is Azure Policy, lesson 13), and does not report outages (that is Azure Service Health).
The purpose of tags
A tag is a name-value pair attached to a resource, resource group or subscription as metadata, such as Department: Finance or Environment: Production. Tags cost nothing and change nothing about how a resource runs. They exist so people and tools can find, group and report on resources by meaning rather than by location.
Common uses:
- Cost reporting. Tag every resource with a CostCenter, then group actual costs by that tag in cost analysis. Because tags cut across resource groups and subscriptions, they are the simplest way to report the total cost of a project whose resources are scattered. Moving everything into one resource group would be heavy, disruptive work for the same answer.
- Resource management. Find every resource that belongs to an application or an owner.
- Operations and automation. A script can select every VM tagged with a particular patch schedule and update just those.
- Governance. Record things such as the environment or the data's sensitivity, so policies and reviews can act on them.
Rules to remember:
- Tags are not inherited by default. A tag on a resource group does not flow down to the resources inside it, so a new VM in a tagged group starts with no tags.
- Azure Policy enforces tags. It can require a tag, deny deployments that lack one, or add or inherit a tag automatically. RBAC cannot check tags; resource locks do not add them.
- Tags are plain text. Anyone with read access, and cost reports, can see them. Never put secrets such as connection strings, or personal data, in a tag.
- Tags grant no access and protect nothing. Permissions come from RBAC (lesson 11); protection from deletion comes from resource locks (lesson 13).
What the exam is really asking
- Estimate or actual? Before deployment, or with no subscription: the pricing calculator. What was spent, by service or by tag: cost analysis in Cost Management. On track to overrun: the forecast. Tell me when we reach a threshold: a budget with alert conditions. Tell me about an unusual spike under the budget: anomaly alerts. Files for our own tools: exports.
- Which factor? Different regions, different rates: location. Same data, different tier: resource type and settings. Hourly copies between regions: data transfer. Same workload, different contract: subscription or offer type.
- Which purchase option? Interruptible: Spot. Steady and fixed shape: reservations. Steady spend, changing shape: savings plan. Licences already owned: Azure Hybrid Benefit.
- VM state. Shut down from the guest: still allocated, still charged. Deallocated: compute stops, disks still billed.
The traps are budgets that seem to stop spending (they only alert), tags that seem to flow down from resource groups (they do not), inbound data that seems to be charged (it generally is not), and the pricing calculator being mistaken for a report of real spend.
Practise what you just read
1. A company prices the same virtual machine size in two different Azure regions and sees two different hourly rates. Which cost factor explains the difference?
Select one
Show answer
A. Azure prices many services differently from one region to another, because the cost of running datacenters varies by location, so the geographic location of the resource changes its rate. The subscription offer the company uses is the same for both quotes, so it cannot explain why the two regions differ.
2. A start-up has no Azure subscription yet and wants a monthly estimate for two virtual machines, a SQL database and some storage before it commits. Which tool should it use?
Select one
Show answer
C. The Azure pricing calculator builds an estimate for services that have not been deployed yet, and it can be used without a subscription. Cost analysis in Cost Management reports spending that has already happened, so it has nothing to show a company with no resources.
3. A finance team wants each resource labelled with the department that owns it, so that monthly costs can be grouped that way in reports. What should the administrators apply?
Select one
Show answer
B. A name-value tag on each resource, such as Department set to Finance, is metadata that cost analysis can group and filter by. A resource lock on each resource only protects it from deletion or change, and a role assignment controls access, so neither labels costs for reporting.
40 more questions on this lesson are part of the full practice bank.
Hands-on labs
Every lab runs in your own Azure subscription, starts from the budget alert set in lesson 1’s lab, and ends with a clean-up.
Part of the free Microsoft Azure Fundamentals AZ-900 course — 16 lessons and 19 hands-on labs.
This is an independent study companion for the Microsoft Azure Fundamentals (AZ-900) exam and is not produced by or endorsed by Microsoft. Microsoft, Azure and Microsoft Entra are trademarks of the Microsoft group of companies.