Part 7: Cost Management & Budgets
Source: John Savill's Azure Master Class v3 - Part 3: Governance
Video Timestamps: 1:32:00 - 1:51:00
AZ-104 Relevance: ⭐⭐⭐⭐ HIGH - Budgets and cost analysis questions
Cost Management Overview
Access: Portal → Cost Management + Billing
Cost Analysis
Views
| View | Shows |
|---|---|
| Accumulated costs | Running total over time |
| Daily costs | Per-day breakdown |
| Cost by resource | Which resources cost most |
| Cost by service | Which services cost most |
| Cost by tag | Group by your tags |
Grouping & Filtering
Group costs by:
- Resource group
- Resource type
- Location
- Tag
- Subscription
Filter to narrow down specific areas.
Smart Views (Saved Views)
Save commonly used views for quick access:
- Team A's monthly costs
- Production environment costs
- Dev/Test spending
Budgets
Budgets are alerts, not hard limits. They don't stop spending.
Creating a Budget
- Scope: Where (Subscription, RG, etc.)
- Amount: Dollar value
- Reset period: Monthly, Quarterly, Annually
- Alerts: At what % to notify
Alert Thresholds
| Type | Triggers When |
|---|---|
| Actual | Spent amount reaches threshold |
| Forecast | Projected spending will exceed |
Alert Actions
When threshold hit:
- Email notification
- Action Group (webhook, function, logic app)
Important: Budgets do NOT stop resources. They only alert!
Cost Allocation
The Tag Problem
Tags don't inherit. How do you track costs across resources?
Tag Inheritance for Billing
Portal → Cost Management → Cost allocation (Preview)
Options:
- Inherit from subscription - Resources get subscription's tags for billing
- Inherit from resource group - Resources get RG's tags for billing
This is for billing purposes only - doesn't change actual resource tags.
Cost Allocation Rules
For shared resources (like a log analytics workspace):
- Create allocation rule
- Define source (shared resource)
- Define targets (distribute to subscriptions/RGs)
- Choose split method (equal, proportional, fixed %)
Exports
Schedule automatic export of cost data:
| Setting | Options |
|---|---|
| Frequency | Daily, Weekly, Monthly |
| Format | CSV |
| Destination | Storage Account |
| Content | Amortized, Actual, Usage |
Use for:
- Building custom dashboards
- Power BI reports
- Long-term storage/analysis
Invoice & Billing
Invoices
Portal → Cost Management + Billing → Invoices
- View current and past invoices
- Download PDF
- See billing period breakdown
Billing Scopes
| Scope | Description |
|---|---|
| Billing account | Top level (EA, MCA, etc.) |
| Billing profile | Invoice recipient |
| Invoice section | Grouping on invoice |
| Subscription | Individual sub |
Cost Visibility at Different Scopes
| Scope | What You See |
|---|---|
| Management Group | All subscriptions below |
| Subscription | All RGs in that sub |
| Resource Group | All resources in that RG |
Costs aggregate UP the hierarchy (unlike RBAC/Policy which goes DOWN).
Tips for Cost Control
| Strategy | Implementation |
|---|---|
| Tag everything | CostCenter, Environment, Owner |
| Budget alerts | Set at subscription level |
| Review regularly | Weekly cost analysis |
| Use reserved instances | For predictable workloads |
| Right-size resources | Azure Advisor recommendations |
| Auto-shutdown | Dev/Test VMs |
Mental Model
Budget = Speedometer Warning 🚗
- Dashboard shows your speed (spending)
- Warning light at 80% (alert)
- Doesn't hit the brakes for you
- YOU must take action
Cost Allocation = Splitting the Bill 🧾
- Shared resource (like shared appetizer)
- Split cost fairly across teams
- Everyone sees their portion
AZ-104 Exam Tips
| Topic | Key Point |
|---|---|
| Budgets | Alert only, don't stop spending |
| Forecast alerts | Predict overspend before it happens |
| Tag inheritance | Available for billing, not actual resources |
| Cost allocation | For shared resources |
| Cost flows | Aggregates UP (vs RBAC/Policy DOWN) |
| Export | To storage account, CSV format |
Practical Exercises
Exercise 1: Explore Cost Analysis (5 min)
- Portal → Cost Management → Cost analysis
- Change view to "Cost by resource"
- Try grouping by Tag
- Save as a custom view
Exercise 2: Create a Budget (5 min)
- Portal → Cost Management → Budgets
- Add a budget for your subscription
- Set a small amount (e.g., $10)
- Add alert at 50% and 80%
- Add your email for notifications
Exercise 3: Review Billing (3 min)
- Portal → Cost Management + Billing → Invoices
- View current billing period
- Note the invoice sections and totals
End of Part 7