# Cost Management — Azure

Source: https://www.skillbyai.com/en/azure/p-cost

> Estimate, track and reduce Azure spending.

## Know the bill before it arrives

Use the **Azure pricing calculator** to estimate a design before building it, and remember the hidden lines: data egress, log ingestion, public IPs, idle disks and backups. **Cost Management** shows actual spend by subscription, resource group, service and **tag**, so consistent tags such as `env`, `owner` and `costCenter` pay off. Create **budgets** with alert thresholds (for example at 80% and 100%). To reduce cost: **right-size** resources using Azure Advisor's recommendations; deallocate or auto-shutdown dev VMs; use autoscale and scale-to-zero services; move cold data to cheaper tiers; commit to steady workloads with **Reservations** (one or three years for specific resources) or a **Savings plan for compute** (an hourly spend commitment that is more flexible across services and regions); and use **Azure Hybrid Benefit** if you already own Windows Server or SQL Server licences.

## A monthly budget with an alert

Budgets do not stop resources; they notify you so a person can act.

```bash
az consumption budget create \
  --budget-name shop-dev-monthly \
  --amount 20000 \
  --category cost \
  --time-grain monthly \
  --start-date 2026-10-01 --end-date 2027-09-30 \
  --resource-group rg-shop-dev-cin
# then add notification thresholds and contact emails in Cost Management

az advisor recommendation list --category Cost -o table
```

## An electricity meter with a buzzer

Cost Management is the meter on the wall, tags tell you which room is using power, and a budget is a buzzer that sounds at 80%. It does not switch the lights off; someone still has to walk over and do it.

**Quiz:** A VM runs 24×7 for the next three years with a fixed size. What usually gives the largest discount?

- [ ] Spot VMs
- [x] A three-year reservation (or savings plan)
- [ ] Moving disks to Archive tier
- [ ] A budget alert

*Answer:* A three-year reservation (or savings plan). Long-term commitments such as reservations and savings plans give large discounts for steady usage.
