Skip to content

Cost Management

First PublishedByAtif Alam

Cloud costs grow quickly without visibility and discipline. Azure Cost Management + Billing provides the tools to understand, allocate, and optimize spending across subscriptions and resource groups.

ToolWhat It DoesAWS Equivalent
Cost AnalysisExplore costs with charts and filtersCost Explorer
BudgetsSet spending limits with alertsAWS Budgets
Advisor (cost)Right-sizing and idle resource recommendationsTrusted Advisor
Pricing CalculatorEstimate costs before deployingAWS Pricing Calculator
Azure ReservationsPre-pay for 1/3 year discountsSavings Plans / Reserved Instances

Cost Analysis is the primary tool for exploring your Azure spending:

Filter by:
├── Subscription
├── Resource group
├── Service name (e.g. Virtual Machines, Storage)
├── Location
├── Tag (e.g. Environment=production)
└── Time range
View as:
├── Accumulated cost (running total)
├── Daily cost (bar chart)
├── Cost by service
├── Cost by resource group
└── Cost by tag
ViewQuestion It Answers
Cost by serviceWhich Azure services cost the most?
Cost by resource groupWhich teams or applications spend the most?
Cost by tagHow much does each environment (prod/dev) cost?
Daily costIs spending trending up or down?
ForecastWhat will this month’s bill be?
Terminal window
# View cost for the current month by resource group
az costmanagement query \
--type ActualCost \
--scope "subscriptions/<subscription-id>" \
--timeframe MonthToDate \
--dataset-grouping name="ResourceGroup" type="Dimension"

Budgets alert you (and optionally take action) when spending reaches thresholds:

Terminal window
# Create a monthly budget of $5,000
az consumption budget create \
--budget-name "monthly-limit" \
--amount 5000 \
--time-grain Monthly \
--start-date 2026-02-01 \
--end-date 2027-01-31 \
--resource-group myapp-prod-rg
# Alert thresholds are configured in the portal or ARM/Bicep
ThresholdTypical Action
50%Informational email to the team
80%Warning email to team leads
100%Alert to finance and engineering managers
120% (forecast)Trigger automation (e.g. stop non-critical VMs)

Budgets can trigger action groups that:

  • Send email/SMS notifications.
  • Call a webhook.
  • Trigger an Azure Function or Logic App (e.g. to shut down dev VMs).

Tags are the foundation of cost management — without them, you can’t attribute costs to teams, applications, or environments.

TagPurposeExample Values
EnvironmentSeparate prod vs dev costsproduction, staging, development
TeamOwning teamplatform, backend, data
CostCenterFinance cost centerCC-1234, engineering
ApplicationApplication nameweb-portal, api-service
ManagedByIaC toolterraform, bicep, manual

Use Azure Policy to enforce required tags — deny resource creation if tags are missing.

Once tags are applied, filter Cost Analysis by tag:

Cost by tag: Environment
production $12,500 (72%)
staging $2,800 (16%)
development $2,100 (12%)
──────────────────────
Total $17,400

Azure Advisor automatically detects optimization opportunities:

RecommendationWhat It Finds
Right-size VMsVMs with <5% average CPU — downsize or shut down
Shut down unused VMsVMs running but with no network/disk activity
Delete unattached disksManaged disks not attached to any VM
Use Reserved InstancesSteady-state VMs that would save with 1/3-year commit
Switch to cheaper storage tiersBlob data that hasn’t been accessed (move to Cool/Archive)
Delete unused public IPsStatic public IPs not associated with any resource
Terminal window
# View cost recommendations
az advisor recommendation list --category Cost

Pre-pay for a specific resource type and size for 1 or 3 years:

Resource1-Year Discount3-Year Discount
VMs~30–40%~55–65%
SQL Database~30%~55%
Cosmos DB (RUs)~20%~40%
App Service (Isolated)~35%~55%

Reservations apply to a specific VM size and region. They can be scoped to a subscription, resource group, or shared across subscriptions.

More flexible than reservations — commit to a dollar amount per hour across any VM size/region:

Savings Plan: $10/hour compute commitment (3-year)
├── Covers any VM size in any region
├── Covers App Service Premium
└── Covers Azure Functions Premium
Discount: ~50–65% (varies by resource)
ReservationsSavings Plans
ScopeSpecific size + regionAny size, any region
FlexibilityLow (exchange/refund available)High (automatic)
DiscountSlightly higherSlightly lower
Best forStable, predictable workloadsVariable or multi-region workloads

Use Azure Spot VMs for fault-tolerant workloads at up to 90% discount:

Terminal window
# Create a Spot VM
az vm create \
--resource-group myapp-rg \
--name batch-worker \
--image Ubuntu2204 \
--size Standard_D4s_v5 \
--priority Spot \
--eviction-policy Deallocate \
--max-price 0.10

Spot VMs can be evicted when Azure needs the capacity. Use them for batch processing, CI/CD, dev/test, and stateless workloads.

TrapPrevention
Forgotten dev/test VMsAuto-shutdown schedule, budget alerts, Environment tag
Oversized VMsStart small, use Advisor right-sizing recommendations
Premium storage for devUse Standard SSD for non-production
Unattached disksPeriodic cleanup, Advisor alerts
Idle Application Gateways~$175/month even with no traffic — delete when not needed
Log Analytics over-ingestionSet daily caps, archive old data, filter noisy logs
Public IPsStatic public IPs cost ~$3.65/month each — delete unused ones
ExpressRoute / VPN GatewaysFixed monthly cost even when idle — right-size or remove
  1. Auto-shutdown dev/test VMs at end of day.
  2. Delete unattached disks and unused public IPs.
  3. Move cold blobs to Cool or Archive tier.
  4. Right-size VMs based on Advisor recommendations.
  5. Use B-series VMs for bursty, low-utilization workloads.
  1. Buy Reservations for stable production VMs and databases.
  2. Use Spot VMs for batch processing and CI/CD.
  3. Azure SQL Serverless for databases with intermittent usage (auto-pause).
  4. Cosmos DB autoscale instead of fixed throughput.
  5. Azure Functions Consumption plan for event-driven workloads.
  1. Enforce tags via Azure Policy for cost attribution.
  2. Set budgets per resource group and subscription.
  3. Separate subscriptions for prod, dev, and sandbox.
  4. Monthly cost reviews — review Cost Analysis with team leads.
  5. Use management groups for consolidated billing visibility.

For organizations with multiple subscriptions:

Management Group: Company
├── Production MG
│ ├── Sub: prod-web (Budget: $10,000)
│ └── Sub: prod-data (Budget: $8,000)
├── Development MG
│ ├── Sub: dev (Budget: $2,000)
│ └── Sub: sandbox (Budget: $500)
└── Platform MG
└── Sub: shared-services (Budget: $5,000)

Cost Management supports viewing costs across all subscriptions under a management group — useful for finance and engineering leadership.

  • Cost Analysis is your main tool — filter by service, resource group, tag, and time range.
  • Budgets with alert thresholds catch spending surprises before the bill arrives.
  • Tags (enforced via policy) are the foundation of cost attribution — require Environment, Team, and CostCenter.
  • Advisor automatically finds right-sizing opportunities, idle resources, and reservation candidates.
  • Reservations save 30–65% for steady-state workloads; Savings Plans offer flexibility.
  • Spot VMs offer up to 90% discount for fault-tolerant workloads.
  • Common traps: forgotten dev VMs, oversized resources, unattached disks, premium storage in dev.