Azure Cheatsheet
Cost and Free Tier
Use this Azure reference while you build software engineering projects, review code, or refresh the syntax you reach for most.
Free Account Tiers
Azure has two permanent free structures:
| Type | Duration | What's free |
|---|---|---|
| Always Free | Permanent | A fixed set of services at limited scale |
| 12-Month Free | First year only | Key services with generous limits |
| $200 credit | First 30 days | Spend on anything |
Sign up: azure.microsoft.com/free
Always Free (no expiry)
| Service | Free limit |
|---|---|
| Azure Functions | 1M requests + 400,000 GB-s/month |
| Cosmos DB | 1,000 RU/s + 25 GB storage |
| App Service | 10 apps on F1 (shared, 60 min CPU/day) |
| Azure DevOps | 5 users, unlimited private repos |
| GitHub Actions (Azure-hosted) | 2,000 min/month (public repos: unlimited) |
| Azure Kubernetes Service | No charge for cluster management (pay for VMs) |
| Container Registry | — (Basic SKU ~$5/mo — not free) |
| Azure SQL (Serverless) | 100,000 vCore-seconds + 32 GB (12-mo only) |
| Bandwidth | 15 GB/month outbound (first 5 GB free globally) |
| Azure Active Directory (Entra ID) | Free tier — up to 50,000 objects |
| Key Vault | 10,000 operations/month |
| Monitor (Metrics) | Built-in platform metrics free forever |
| Monitor (Logs) | 5 GB Log Analytics ingestion/month |
12-Month Free Highlights
| Service | Free limit | Notes |
|---|---|---|
| Linux/Windows VMs | 750 hrs/month × 2 (B1s) | One Linux + one Windows |
| Blob Storage | 5 GB LRS + 20k reads + 10k writes | Standard tier |
| Azure SQL Database | 100,000 vCore-seconds + 32 GB | Serverless Gen5 |
| Cognitive Services | 5,000 transactions/month | Face, Vision, Language |
| Bandwidth | 15 GB outbound | First 15 GB free each month |
Key Pricing Concepts
Compute
VMs are billed per second of uptime (when allocated). Stop + Deallocate → no compute charge (disk still billed). Stop only (OS shutdown) → still billed! Savings options: Reserved Instances (1yr / 3yr) → up to 72% off pay-as-you-go Azure Hybrid Benefit → bring existing Windows Server / SQL licenses Spot VMs → up to 90% off, can be evicted at any time Dev/Test pricing → discounted rates for non-prod (requires MSDN)
Storage
| Tier | Use | $/GB/month (LRS, East US) |
|---|---|---|
| Hot | Frequent access | ~$0.018 |
| Cool | Infrequent (≥30 days) | ~$0.01 |
| Cold | Rarely accessed (≥90 days) | ~$0.0045 |
| Archive | Offline (≥180 days, 15h rehydrate) | ~$0.00099 |
Networking
Inbound data transfer: FREE Outbound (internet): First 100 GB/month FREE, then ~$0.087/GB (Zone 1) VNet-to-VNet peering: ~$0.01/GB ExpressRoute: Port fee + data (varies by circuit)
Database
Azure SQL (vCore General Purpose, East US): GP_Gen5_2: ~$0.3685/vCore/hour (~$536/month per 2 vCores) Serverless: billed only when DB is active (auto-pause available) Reserved 1yr: ~37% discount; 3yr: ~55% discount Cosmos DB: Provisioned: $0.008/hour per 100 RU/s + $0.25/GB Serverless: $0.25 per 1M RUs + $0.25/GB
Cost Management Tools
# Show current month's cost (requires Billing Reader role) az consumption usage list \ --start-date 2024-06-01 --end-date 2024-06-30 \ -o table # Show cost by resource group (Cost Management extension) az extension add --name costmanagement az costmanagement query \ --type Usage \ --timeframe MonthToDate \ --dataset-granularity Daily \ --dataset-aggregation '{"totalCost":{"name":"Cost","function":"Sum"}}' \ --dataset-grouping '{"name":"ResourceGroupName","type":"Dimension"}' \ -o table # Create a budget with email alert az consumption budget create \ --budget-name myBudget \ --amount 100 \ --time-grain Monthly \ --category Cost \ --notifications '[{"enabled":true,"operator":"GreaterThan","threshold":80,"contactEmails":["admin@example.com"],"thresholdType":"Actual"}]' # List budgets az consumption budget list -o table
Cost Reduction Checklist
- Deallocate VMs when not in use (az vm deallocate).
- Use Spot VMs for fault-tolerant batch jobs.
- Purchase Reserved Instances for stable 1–3yr workloads (>72% savings).
- Enable Azure Hybrid Benefit if you have Windows Server / SQL Server licenses.
- Set auto-pause on serverless SQL databases (--auto-pause-delay 60).
- Lifecycle management on Blob Storage — move cold data to Cool → Archive.
- Right-size VMs with Azure Advisor recommendations:
``bash
az advisor recommendation list --category Cost -o table
``
- Use Azure Dev/Test subscriptions for non-production workloads.
- Enable Budget alerts so you know before you overspend.
- Delete unused Public IPs, unattached disks, and empty resource groups.
Azure Pricing Calculator
Use the web calculator for estimates before deploying: azure.microsoft.com/pricing/calculator
# Compare reservation savings for a VM size az vm list-skus --location eastus --size Standard_D4s_v5 \ --query "[].{Name:name,Tier:tier,Size:size}" -o table