Every Azure resource is metered, and the bill is just meters multiplied by prices. This part takes the bill apart: the handful of dimensions everything is priced on, the factors that move the price, which resources keep charging while doing nothing, how to estimate before building, and the tools and habits that keep costs visible and small.
This is the sixth part of the Azure series. Part 1 named measured service as one of the five properties of a cloud: you pay for what you use. That is a gift when usage is low and a trap when something is left running. This part explains exactly how usage becomes money, so that the cost of a design is something you can reason about before building it, not something you discover at the end of the month.
There are deliberately almost no prices in this part. Prices differ by region and currency, and they change. What does not change is how things are priced, and that is what is worth learning.
This is the first of four parts about money. This one covers how any bill is built. Part 7 compares the two ways of paying for compute, provisioned and serverless, and the maths that decides between them. Part 8 covers commitment discounts: reservations, savings plans and Azure Hybrid Benefit. Part 9 puts all of it together by reading a real-style cost decision from start to finish.
Each resource you create reports its usage on one or more meters. A meter measures one thing in one unit: hours a VM ran, gigabytes stored for a month, millions of function executions, gigabytes of data sent out to the internet. At the end of the billing period, each meter's usage is multiplied by its price, and the results are added up.
your bill = sum over every meter of (usage on that meter × price per unit)A single resource often has several meters. A storage account, for example, is billed for how much data it holds, for the operations performed on it, and for data transferred out of it. So the question "how much does a storage account cost?" has no single answer; it depends on how it is used.
Price lists and cost reports use a small set of units. They look odd at first, but each is just "amount of something × how long you had it":
| Unit | Read it as | Example |
|---|---|---|
| vCore | one virtual processor core: the unit compute capacity is sized and sold in | a database "with 8 vCores" |
| vCore-hour | one vCore allocated (or used) for one hour | 8 vCores for 10 hours = 80 vCore-hours |
| vCore-second | the same, per second: serverless services bill at this granularity | 8 vCores for 90 seconds = 720 vCore-seconds |
| GB-month | one gigabyte stored for a whole month | 50 GB kept for half a month = 25 GB-months |
| GB-second | one gigabyte of memory held for one second (Functions) | a 0.5 GB function running 2 s = 1 GB-second |
| per 10,000 operations | transactions, sold in batches | 1 million blob reads = 100 batches |
A vCore deserves a moment, because database and compute pricing is built on it. It is a share of a physical processor on the hypervisor from Part 1: Azure sells compute as a number of vCores, and the memory that comes with them is usually fixed per vCore (a few gigabytes each, depending on the hardware). So "a bigger database" mostly means "more vCores, and the memory that comes with them".
Two conversions turn up in every cost calculation, so they are worth memorizing:
1 month ≈ 730 hours (365 days × 24 hours ÷ 12)
1 year = 8,760 hours (365 × 24)
monthly cost = vCores × price per vCore-hour × 730
yearly cost = vCores × price per vCore-hour × 8,760At USD 0.25 per vCore-hour, a database that runs 8 vCores all the time costs 8 × 0.25 × 730 = USD 1,460 a month. Small hourly prices become large monthly numbers, because there are a lot of hours in a month.
Part 3 showed that reliability comes from keeping copies in places that do not fail together. The bill follows the same rule: each copy that runs compute has its own meter.
So when a design says "8 vCores with one HA replica", the compute bill is for 16 vCores. This is the single most common mistake when estimating database costs: pricing the size you picked, and forgetting it runs twice.
Almost every Azure meter falls into one of a few families. Recognising which families a service uses is most of the skill of estimating its cost:
| Dimension | Unit | Typical services |
|---|---|---|
| Compute time | per second or per hour that capacity is allocated | VMs, App Service plans, provisioned databases, Redis |
| Execution | per execution, plus memory × duration (GB-seconds) | Azure Functions on consumption plans |
| Storage capacity | per GB per month | Blob storage, disks, database storage, backups |
| Operations | per batch of transactions (often per 10,000) | storage reads and writes, queue messages, Key Vault operations |
| Data transfer | per GB leaving a region | traffic to the internet, between regions |
| Data ingestion | per GB received | Application Insights and Log Analytics |
| Throughput | per unit of reserved capacity per hour | Cosmos DB request units, some messaging tiers |
Two of these surprise people more than the others:
Data transfer. Sending data into Azure is generally free. Sending it out of Azure to the internet is charged per gigabyte, after a small free allowance, and so is sending it between regions. An app that serves large files to many users can find its bandwidth bill larger than its compute bill. This is also one more reason, alongside latency, to keep an application's resources in one region.
Monitoring data. Application Insights and Log Analytics charge mostly by the volume of log data ingested. A service that logs every request in detail at high traffic can produce a surprising monitoring bill. The Monitoring topic covers sampling and filtering for exactly this reason.
The same resource can cost very different amounts depending on choices made when creating it:
| Factor | Effect |
|---|---|
| Region | the same service is priced differently in different regions |
| Tier or SKU | Basic, Standard, Premium and similar tiers trade price against features, limits and SLAs |
| Size | more processors and memory cost proportionally more |
| Redundancy | ZRS and geo-redundant options cost more than LRS, because more copies are kept |
| Compute model | the same database can be provisioned (a fixed size, billed every hour) or serverless (billed per second for what it uses), at very different prices per vCore (Part 7) |
| Commitment | reservations and savings plans give a discount in exchange for committing to 1 or 3 years of usage (Part 8) |
| Interruptible capacity | Spot VMs use Azure's spare capacity at a deep discount, but can be evicted at short notice |
| Existing licences | Azure Hybrid Benefit lets customers apply Windows Server and SQL Server licences they already own (Part 8) |
| Dev/Test pricing | eligible subscriptions get reduced rates for non-production workloads |
For learning, the first four matter. The compute model, commitments and licence benefits are the big levers for organizations running steady production workloads, and they get the next two parts to themselves.
"The price" of a meter is really three different numbers, and cost documents use all of them:
| Price | What it is | Where you see it |
|---|---|---|
| Retail price (list price, pay-as-you-go price) | the public price anyone pays with no agreement or discount | the pricing pages, the pricing calculator, the Retail Prices API |
| Negotiated price | a lower price agreed in a company's contract with Microsoft | the portal and cost reports of that company's subscriptions |
| Effective price (effective rate) | what you actually paid per unit, after every discount, credit and commitment | cost analysis: total cost ÷ units used |
The effective price is the one that matters for decisions. Two companies running the same database in the same region can have different effective prices, because one has a contract discount or a reservation and the other does not. When a cost document says "the retail price is 0.50 but our effective rate is 0.45", it means a discount already applies to that meter.
Retail prices are available as data, not only on web pages. The Azure Retail Prices API is a public, unauthenticated web API that returns the list price of every meter, filterable by service, region and currency:
# Retail prices for Azure SQL Database meters in West Europe, in euros
curl -G "https://prices.azure.com/api/retail/prices" \
--data-urlencode "currencyCode='EUR'" \
--data-urlencode "\$filter=serviceName eq 'SQL Database' and armRegionName eq 'westeurope'"Each item in the response names the meter, its unit (for example "1 Hour") and its retailPrice. It never includes negotiated or reserved discounts for your account; for those, you look at your own cost data in Cost Management. Cost analyses quote "prices from the Retail Prices API on a given date" for exactly this reason: they are public, reproducible, and the same for everyone.
The single most useful question to ask about any resource is: am I paying for capacity that exists, or for work that happens?
This is the cost side of Part 1's service models. Serverless and consumption-based services can scale to zero, so their idle cost is near zero. Provisioned services cannot, so their idle cost is the full price. Neither is better in general: steady, heavy traffic is often cheaper on provisioned capacity, while bursty or low traffic is usually cheaper on consumption. Part 7 turns this rule of thumb into actual arithmetic, including the surprising case where a "pay for what you use" database ends up far more expensive than a fixed one.
These are the usual sources of surprise bills in a learning subscription, all from the "allocated" side:
| Resource | The trap |
|---|---|
| Virtual machines | a VM shut down from inside its operating system is still allocated, and still charged for compute. Only Stop (deallocate) in Azure releases the compute. |
| Managed disks | a VM's disks are charged even when the VM is deallocated. Only deleting them stops the charge. |
| Public IP addresses | charged per hour while they exist, even if attached to nothing. |
| App Service plans | the plan is the bill, whether it runs ten apps, one app or none. Stopping an app does not stop the plan's charges. Only the Free tier, or deleting the plan, does. |
| Provisioned databases | an Azure SQL database on a provisioned tier is charged every hour. (Its serverless tier can pause automatically when idle, after which only storage is charged.) |
| Redis caches | charged per hour for as long as they exist. |
| Gateways and firewalls | VPN gateways, application gateways and Azure Firewall carry significant hourly charges. |
| Logs | monitoring keeps ingesting and retaining data, and charging for it, as long as something emits it. |
By contrast, the core of this path is gentle on cost: Azurite and local tools are free, a storage account holding a few test files costs almost nothing, and a Functions consumption plan includes a monthly free grant (on the classic Consumption plan, 1 million executions and 400,000 GB-seconds of execution time per subscription).
The hierarchy from Part 2 meets the money here:
For a single learner the picture is simple: one billing account, one subscription, one invoice per month, and the free credit applied first.
The Azure Pricing Calculator is a free web tool where you add the services you plan to use, choose region, tier and size, enter expected usage, and get an estimated monthly cost. It is worth using for anything beyond a toy, because it forces the right questions: how many hours will this run? How much data will it store? How many requests? How much will it send to the internet?
The method matters more than the tool. For each resource in a design:
For PhotoDrop at a small scale, this exercise is revealing. The storage, function and queue costs are tied to usage and small at low traffic. The App Service plan for the API is a fixed hourly cost that dominates the bill at low traffic, and the data transfer for serving photos grows with every user. That kind of insight, which cost is fixed and which grows, is exactly what the estimate is for.
Microsoft Cost Management is the built-in set of tools for seeing and controlling spending:
Cost data tells you what you paid. To understand why, it is paired with usage metrics from Azure Monitor: CPU percentage, memory percentage, request counts. A cost question such as "why is this database so expensive?" is almost always answered by putting the two side by side: what was billed, against what was actually used.
Tags from Part 2 become valuable here. With an environment and a project tag on every resource, cost analysis can show "PhotoDrop production" and "PhotoDrop development" as separate lines, even when they share a subscription. Without tags, a shared subscription's bill is one undivided number.
az resource list --output table shows everything that exists and might be costing money.An Azure bill is meters multiplied by prices. Every service is priced on a few dimensions (compute time, executions, storage, operations, data transfer, ingestion), measured in units like vCore-hours and GB-months, and every running copy has its own meter. The crucial question for each resource is whether it is allocated (charged for every hour it exists, even idle) or consumed (charged only for use). Compare costs at the effective price, not the list price. Estimate before building, tag so costs can be attributed, set a budget as an alarm, and delete what you are not using.
This part built the bill. Part 7 zooms in on its biggest line for most applications: compute. It compares the two ways of paying for the same database, provisioned (a fixed size, billed every hour) and serverless (billed per second for what it uses), works through the arithmetic that decides between them, and shows what you take on when you move from one to the other.