Challenge 19: Azure Cost Management & Pricing Calculator
25-35 min | Cost: Free | Domain: Management & Governance (30-35%)
Exam skills covered
- Describe factors that can affect costs in Azure
- Compare the Pricing Calculator and the Total Cost of Ownership (TCO) Calculator
- Describe Cost Management capabilities (cost alerts, budgets, recommendations)
- Describe the purpose of tags
Overview
Understanding Azure costs is critical for any organization. Costs are affected by resource type, usage, region, and data transfer. Azure provides tools to estimate, monitor, and optimize spending: the Pricing Calculator (estimate future costs), TCO Calculator (compare on-premises vs. cloud), and Cost Management (monitor and control current spending).
Explore
Task 1: Understand cost factors
| Factor | Impact on cost | Example |
|---|---|---|
| Resource type | Different services have different pricing | VMs cost more than storage |
| Region | Prices vary by region | East US may differ from West Europe |
| Usage/consumption | More usage = higher cost | Running a VM 24/7 vs. 8 hours/day |
| Data transfer | Inbound free, outbound costs money | Downloading data FROM Azure |
| Tier/SKU | Higher tiers cost more | Premium SSD vs. Standard HDD |
| Reserved capacity | Commitment = discount | 1-year or 3-year reservation |
Task 2: Use the Pricing Calculator
- Open azure.microsoft.com/pricing/calculator
- Add a Virtual Machine:
- Region: East US, Linux, D2s v3
- Note the monthly cost
- Add a Storage Account:
- LRS, Hot tier, 100 GB
- Note the cost (much cheaper than VMs!)
- Add an App Service:
- Basic tier B1
- Note the monthly cost
- Compare total — observe that VMs are usually the largest cost
Task 3: Explore Cost Management
- In Azure Portal, search for Cost Management
- Explore these sections:
- Cost analysis: View spending by service, resource group, location
- Budgets: Set spending limits with alerts
- Advisor recommendations: Cost-saving suggestions
- Alerts: Get notified when spending exceeds thresholds
- If your account is new, data may be minimal — that's OK
Task 4: Understand tags for cost tracking
Tags are name-value pairs you attach to resources for organization:
| Tag key | Tag value | Purpose |
|---|---|---|
Environment | Production | Identify production resources |
CostCenter | IT-1234 | Track costs by department |
Owner | alice@contoso.com | Know who owns the resource |
Project | WebApp-v2 | Associate costs with projects |
Tag rules:
- Tags are NOT inherited (parent RG tags don't automatically apply to resources)
- You can have up to 50 tags per resource
- Tags enable cost filtering in Cost Management
- Azure Policy can enforce tag requirements
Task 5: Ways to reduce costs
| Strategy | Description | Savings |
|---|---|---|
| Reserved Instances | Commit to 1 or 3 years | Up to 72% off |
| Azure Hybrid Benefit | Use existing Windows/SQL licenses | Up to 40% off |
| Spot VMs | Use unused capacity (can be evicted) | Up to 90% off |
| Right-sizing | Match VM size to actual usage | Varies |
| Auto-shutdown | Stop dev/test VMs at night | Up to 70% off |
| Azure Advisor | Follow cost recommendations | Varies |
# List tags on a resource group
az group show --name rg-az900-learning --query tags --output table 2>/dev/null || echo "No tags set"
# Add a tag to a resource group
az group update --name rg-az900-learning --tags Environment=Learning CostCenter=Training 2>/dev/null || echo "Create the RG first in Challenge 08"
Key Concepts
| Concept | Description |
|---|---|
| Pricing Calculator | Estimate costs for new Azure deployments |
| TCO Calculator | Compare on-premises costs with Azure costs over time |
| Cost Management | Monitor, allocate, and optimize Azure spending |
| Budget | Set spending limits with automatic alerts |
| Tags | Key-value pairs for organizing and tracking resource costs |
| Reserved Instance | Pre-commit to 1-3 year term for significant discount |
| Azure Advisor | Personalized recommendations including cost savings |
Knowledge Check
1. Which Azure tool should you use to estimate the monthly cost of a new deployment before creating any resources?
2. Data transfer INTO Azure (ingress) is:
3. What is the purpose of resource tags in Azure?
4. A company wants to reduce VM costs by committing to a specific VM size for 3 years. What pricing option provides the best discount?
5. Are resource tags automatically inherited from a resource group to its resources?