Pricing, budgets and cost analysis

Microsoft Azure · Essentials · 10 min

Cloud bills grow quietly; knowing the meters and setting budgets early avoids nasty surprises.

Azure charges per meter: VM compute per second, storage per GB-month plus per-transaction, outbound data per GB, functions per execution, and so on. The same service can cost very differently by region, tier and redundancy.

Tools to know:

  • The pricing calculator estimates a design before you build it.
  • Cost Management + Billing, Cost analysis: actual and forecast cost, grouped by subscription, resource group, service, meter or tag.
  • Budgets: a monthly, quarterly or yearly amount at a scope with alert thresholds (e.g. 80% actual, 100% forecast) that email people or trigger an action group. A budget does not stop spending by itself.
  • Azure Advisor cost recommendations: idle or oversized resources.

Habits that keep costs predictable:

  • Tag resources with owner, environment and cost center, and enforce tags with Policy.
  • Delete dev resource groups when done; deallocate idle VMs; use auto-shutdown for dev boxes.
  • Watch the classic surprises: data egress, premium disks left after deleting a VM, Log Analytics ingestion, public IPs, and forgotten NAT gateways or firewalls that bill per hour.

Pricing for many services changes, so always check the region-specific pricing page rather than memorized numbers.

Example

az consumption budget create --budget-name dev-monthly \
  --amount 500 --category cost --time-grain monthly \
  --start-date 2026-11-01 --end-date 2027-10-31 \
  --resource-group rg-orders-dev

# Month-to-date cost by resource group (Cost Management query API)
az rest --method post \
  --url "https://management.azure.com/subscriptions/$SUB/providers/Microsoft.CostManagement/query?api-version=2023-11-01" \
  --body '{"type":"ActualCost","timeframe":"MonthToDate",
    "dataset":{"granularity":"None","aggregation":{"cost":{"name":"Cost","function":"Sum"}},
    "grouping":[{"type":"Dimension","name":"ResourceGroupName"}]}}'

Remember

  • Every service bills per meter; region and tier change the price
  • Budgets alert but never stop resources
  • Tags make cost allocation possible
  • Egress, logs, disks and idle network appliances are common surprises

Watch out for

  • Expecting a budget to cap spending: it only sends alerts or triggers actions you configure.

Check yourself

  1. Your budget of 500 hits 100%. What does Azure do by default?

Sign in to answer, see the explanations, and get this lesson back as a quick review later.

Official docs: learn.microsoft.com/en-us/azure/cost-management-billing/costs/tutorial-acm-create-budgets