Installation
npx skills add microsoft/azure-skills --skill azure-cost 66.5K
Installs
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 restonly 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:
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) - Always include the
ClientType: GitHubCopilotForAzureheader on all Cost Management API requests (--headers "ClientType=GitHubCopilotForAzure"inaz rest) - 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
- On 429 responses, check all
x-ms-ratelimit-microsoft.costmanagement-*-retry-afterheaders (qpu-retry-after,entity-retry-after,tenant-retry-after), wait for the longest value, and do not retry until that duration has elapsed. The per-scope limit (4 requests/minute) is the most restrictive.
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 restwith JSON body, notaz 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
- Redis Management: .NET
Installs
Security Audit
View Source
microsoft/azure-skills
More from this source
Power your AI Agents with
the best open-source models.
Drop-in OpenAI-compatible API. No data leaves Europe.
Explore Inference APIGLM
GLM 5
$1.00 / $3.20
per M tokens
Kimi
Kimi K2.5
$0.60 / $2.80
per M tokens
MiniMax
MiniMax M2.5
$0.30 / $1.20
per M tokens
Qwen
Qwen3.5 122B
$0.40 / $3.00
per M tokens
How to use this skill
Install azure-cost by running npx skills add microsoft/azure-skills --skill azure-cost in your project directory. Run the install command above in your project directory. The skill file will be downloaded from GitHub and placed in your project.
No configuration needed. Your AI agent (Claude Code, Cursor, Windsurf, etc.) automatically detects installed skills and uses them as context when generating code.
The skill enhances your agent's understanding of azure-cost, helping it follow established patterns, avoid common mistakes, and produce production-ready output.
What you get
Skills are plain-text instruction files β not executable code. They encode expert knowledge about frameworks, languages, or tools that your AI agent reads to improve its output. This means zero runtime overhead, no dependency conflicts, and full transparency: you can read and review every instruction before installing.
Compatibility
This skill works with any AI coding agent that supports the skills.sh format, including Claude Code (Anthropic), Cursor, Windsurf, Cline, Aider, and other tools that read project-level context files. Skills are framework-agnostic at the transport level β the content inside determines which language or framework it applies to.
Chat with 100+ AI Models in one App.
Use Claude, ChatGPT, Gemini alongside with EU-Hosted Models like Deepseek, GLM-5, Kimi K2.5 and many more.