| name | cost-analysis |
| description | Break down VM cost in Cost Management — meters, grouping, KQL queries |
Cost Analysis
When to use this skill
- Investigating a cost spike
- Producing a chargeback report
Key concepts
- Group cost by Meter Subcategory to separate compute, disk, bandwidth, license.
- Group by Tag to allocate to apps/environments — requires consistent tagging.
- KQL query in Cost Management exports → Log Analytics for ad-hoc analysis.
- Use Cost Anomaly Detection alerts for proactive spike detection.
- Combine with Reservation Utilization reports to find unused commits.
Azure CLI examples
az costmanagement query \
--type ActualCost \
--timeframe MonthToDate \
--scope "/subscriptions/<sub>" \
--dataset-grouping name=ServiceName type=Dimension
Common pitfalls
- Missing license cost — Windows/SQL meters are separate lines from compute.
- Missing bandwidth — egress isn't in the VM line item.
- Tag inconsistency makes per-app rollups misleading.
References
Validation-first: verify every Azure fact against the Microsoft Learn MCP server (cite the Learn URL); Learn overrides built-in knowledge. If no Learn MCP server is configured, flag the answer ⚠️ unverified and mark specs as indicative. Analysis only — verify against Microsoft documentation before applying.