Azure Cost Management Skill
Unified skill for all Azure cost management tasks: querying historical costs, forecasting future spending, and optimizing to reduce waste.
When to Use This Skill
Activate this skill when user wants to:
- Query or analyze Azure costs (how much am I spending, show my bill, cost breakdown)
- Break down costs by service, resource, location, or tag
- Analyze cost trends over time
- Forecast future Azure spending or project end-of-month costs
- Optimize Azure costs, reduce spending, or find savings
- Find orphaned or unused resources
- Rightsize Azure VMs, containers, or services
- Generate cost optimization reports
Quick Reference
| Property |
Value |
| Query API Endpoint |
POST {scope}/providers/Microsoft.CostManagement/query?api-version=2023-11-01 |
| Forecast API Endpoint |
POST {scope}/providers/Microsoft.CostManagement/forecast?api-version=2023-11-01 |
| MCP Tools |
azure__documentation, azure__extension_cli_generate, azure__get_azure_bestpractices |
| CLI |
az rest, az monitor metrics list, az resource list |
| Required Role |
Cost Management Reader + Monitoring Reader + Reader on scope |
MCP Tools
| Tool |
Description |
Parameters |
When to Use |
azure__documentation |
Search Azure documentation |
query (Required): search terms |
Research Cost Management API parameters and options |
azure__extension_cli_generate |
Generate Azure CLI commands |
intent (Required): task description, cli-type (Required): "az" |
Construct az rest commands for cost queries |
azure__get_azure_bestpractices |
Get Azure best practices |
intent (Required): optimization context |
Inform query design with cost management best practices |
azure__extension_azqr |
Run Azure Quick Review compliance scan |
subscription (Required): subscription ID, resource-group (Optional): resource group name |
Find orphaned resources and cost optimization opportunities |
azure__aks |
Azure Kubernetes Service operations |
varies by sub-command |
AKS cost analysis: list clusters, get node pools, inspect configuration |
💡 Tip: Prefer MCP tools over direct CLI commands. Use az rest only when MCP tools don't cover the specific operation.
Routing
Read the user's request and follow the appropriate workflow below.
| User Intent |
Workflow |
Example Prompts |
| Understand current costs |
Cost Query Workflow |
"how much am I spending", "cost by service", "show my bill" |
| Reduce costs / find waste |
Cost Optimization Workflow |
"optimize costs", "find orphaned resources", "reduce spending" |
| Project future costs |
Cost Forecast Workflow |
"forecast costs", "end of month estimate", "how much will I spend" |
| Full cost picture |
All three workflows combined |
"give me the full picture of my Azure costs" |
Important: When optimizing costs, always present the total bill and cost breakdown alongside optimization recommendations.
Scope Reference (Shared Across All Workflows)
| Scope |
URL Pattern |
| Subscription |
/subscriptions/<subscription-id> |
| Resource Group |
/subscriptions/<subscription-id>/resourceGroups/<resource-group-name> |
| Management Group |
/providers/Microsoft.Management/managementGroups/<management-group-id> |
| Billing Account |
/providers/Microsoft.Billing/billingAccounts/<billing-account-id> |
| Billing Profile |
/providers/Microsoft.Billing/billingAccounts/<billing-account-id>/billingProfiles/<billing-profile-id> |
💡 Tip: These are scope paths only — not complete URLs. Combine with the API endpoint and version.
Part 1: Cost Query Workflow
For the full cost query workflow (scope selection, report types, timeframes, dataset configuration, API calls, pagination, guardrails, examples, and error handling), see:
📄 Cost Query Workflow
Part 2: Cost Optimization Workflow
For the full cost optimization workflow (prerequisites, best practices, Redis/AKS-specific analysis, Azure Quick Review, resource discovery, cost queries, pricing validation, utilization metrics, and report generation), see:
📄 Cost Optimization Workflow
Part 3: Cost Forecast Workflow
For the full cost forecast workflow (scope selection, time period rules, dataset configuration, forecast-specific options, API calls, response interpretation, guardrails, and error handling), see:
📄 Cost Forecast Workflow
Data Classification
- ACTUAL DATA = Retrieved from Azure Cost Management API
- ACTUAL METRICS = Retrieved from Azure Monitor
- VALIDATED PRICING = Retrieved from official Azure pricing pages
- ESTIMATED SAVINGS = Calculated based on actual data and validated pricing
Best Practices
- Always query actual costs first — never estimate or assume
- Always present the total bill alongside optimization recommendations
- Validate pricing from official sources — account for free tiers
- Use REST API for cost queries (more reliable than
az costmanagement query)
- Save audit trail — include all queries and responses
- Include Azure Portal links for all resources
- For costs < $10/month, emphasize operational improvements over financial savings
- Never execute destructive operations without explicit approval
Common Pitfalls
- Assuming costs: Always query actual data from Cost Management API
- Ignoring free tiers: Many services have generous allowances
- Using wrong date ranges: 30 days for costs, 14 days for utilization
- Not showing the bill: Always present cost breakdown alongside optimization recommendations
- Cost query failures: Use
az rest with JSON body, not az costmanagement query
Safety Requirements
- Get approval before deleting resources
- Test changes in non-production first
- Provide dry-run commands for validation
- Include rollback procedures
SDK Quick References
1---2name: azure-cost3description: 'Unified Azure cost management: query historical costs, forecast future4 spending, and optimize to reduce waste. WHEN: "Azure costs", "Azure spending", "Azure5 bill", "cost breakdown", "cost by service", "cost by resource", "how much am I spending",6 "show my bill", "monthly cost summary", "cost tren...'7license: MIT8metadata:9 source: https://skillmd.com/skills/jantoniofc/azure-cost10 author: Microsoft11 version: 1.0.012risk: safe13source: microsoft14---1516# Azure Cost Management Skill1718Unified skill for all Azure cost management tasks: querying historical costs, forecasting future spending, and optimizing to reduce waste.1920## When to Use This Skill2122Activate this skill when user wants to:23- Query or analyze Azure costs (how much am I spending, show my bill, cost breakdown)24- Break down costs by service, resource, location, or tag25- Analyze cost trends over time26- Forecast future Azure spending or project end-of-month costs27- Optimize Azure costs, reduce spending, or find savings28- Find orphaned or unused resources29- Rightsize Azure VMs, containers, or services30- Generate cost optimization reports3132## Quick Reference3334| Property | Value |35|----------|-------|36| **Query API Endpoint** | `POST {scope}/providers/Microsoft.CostManagement/query?api-version=2023-11-01` |37| **Forecast API Endpoint** | `POST {scope}/providers/Microsoft.CostManagement/forecast?api-version=2023-11-01` |38| **MCP Tools** | `azure__documentation`, `azure__extension_cli_generate`, `azure__get_azure_bestpractices` |39| **CLI** | `az rest`, `az monitor metrics list`, `az resource list` |40| **Required Role** | Cost Management Reader + Monitoring Reader + Reader on scope |4142## MCP Tools4344| Tool | Description | Parameters | When to Use |45|------|-------------|------------|-------------|46| `azure__documentation` | Search Azure documentation | `query` (Required): search terms | Research Cost Management API parameters and options |47| `azure__extension_cli_generate` | Generate Azure CLI commands | `intent` (Required): task description, `cli-type` (Required): `"az"` | Construct `az rest` commands for cost queries |48| `azure__get_azure_bestpractices` | Get Azure best practices | `intent` (Required): optimization context | Inform query design with cost management best practices |49| `azure__extension_azqr` | Run Azure Quick Review compliance scan | `subscription` (Required): subscription ID, `resource-group` (Optional): resource group name | Find orphaned resources and cost optimization opportunities |50| `azure__aks` | Azure Kubernetes Service operations | varies by sub-command | AKS cost analysis: list clusters, get node pools, inspect configuration |5152> 💡 **Tip:** Prefer MCP tools over direct CLI commands. Use `az rest` only when MCP tools don't cover the specific operation.5354---5556## Routing5758Read the user's request and follow the appropriate workflow below.5960| User Intent | Workflow | Example Prompts |61|-------------|----------|-----------------|62| Understand current costs | [Cost Query Workflow](cost-query/workflow.md) | "how much am I spending", "cost by service", "show my bill" |63| Reduce costs / find waste | [Cost Optimization Workflow](cost-optimization/workflow.md) | "optimize costs", "find orphaned resources", "reduce spending" |64| Project future costs | [Cost Forecast Workflow](cost-forecast/workflow.md) | "forecast costs", "end of month estimate", "how much will I spend" |65| Full cost picture | All three workflows combined | "give me the full picture of my Azure costs" |6667> **Important:** When optimizing costs, always present the total bill and cost breakdown alongside optimization recommendations.6869---7071## Scope Reference (Shared Across All Workflows)7273| Scope | URL Pattern |74|-------|-------------|75| Subscription | `/subscriptions/<subscription-id>` |76| Resource Group | `/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>` |77| Management Group | `/providers/Microsoft.Management/managementGroups/<management-group-id>` |78| Billing Account | `/providers/Microsoft.Billing/billingAccounts/<billing-account-id>` |79| Billing Profile | `/providers/Microsoft.Billing/billingAccounts/<billing-account-id>/billingProfiles/<billing-profile-id>` |8081> 💡 **Tip:** These are scope paths only — not complete URLs. Combine with the API endpoint and version.8283---8485## Part 1: Cost Query Workflow8687For the full cost query workflow (scope selection, report types, timeframes, dataset configuration, API calls, pagination, guardrails, examples, and error handling), see:8889📄 **[Cost Query Workflow](cost-query/workflow.md)**9091---9293## Part 2: Cost Optimization Workflow9495For the full cost optimization workflow (prerequisites, best practices, Redis/AKS-specific analysis, Azure Quick Review, resource discovery, cost queries, pricing validation, utilization metrics, and report generation), see:9697📄 **[Cost Optimization Workflow](cost-optimization/workflow.md)**9899---100101## Part 3: Cost Forecast Workflow102103For the full cost forecast workflow (scope selection, time period rules, dataset configuration, forecast-specific options, API calls, response interpretation, guardrails, and error handling), see:104105📄 **[Cost Forecast Workflow](cost-forecast/workflow.md)**106107---108109## Data Classification110111- **ACTUAL DATA** = Retrieved from Azure Cost Management API112- **ACTUAL METRICS** = Retrieved from Azure Monitor113- **VALIDATED PRICING** = Retrieved from official Azure pricing pages114- **ESTIMATED SAVINGS** = Calculated based on actual data and validated pricing115116## Best Practices117118- Always query actual costs first — never estimate or assume119- Always present the total bill alongside optimization recommendations120- Validate pricing from official sources — account for free tiers121- Use REST API for cost queries (more reliable than `az costmanagement query`)122- Save audit trail — include all queries and responses123- Include Azure Portal links for all resources124- For costs < $10/month, emphasize operational improvements over financial savings125- Never execute destructive operations without explicit approval126127## Common Pitfalls128129- **Assuming costs**: Always query actual data from Cost Management API130- **Ignoring free tiers**: Many services have generous allowances131- **Using wrong date ranges**: 30 days for costs, 14 days for utilization132- **Not showing the bill**: Always present cost breakdown alongside optimization recommendations133- **Cost query failures**: Use `az rest` with JSON body, not `az costmanagement query`134135## Safety Requirements136137- Get approval before deleting resources138- Test changes in non-production first139- Provide dry-run commands for validation140- Include rollback procedures141142## SDK Quick References143144- **Redis Management**: [.NET](cost-optimization/sdk/azure-resource-manager-redis-dotnet.md)