.github/plugins/azure-skills/skills/azure-cost/SKILL.md
Unified Azure cost management: query historical costs, forecast future spending, and optimize to reduce waste. WHEN: "Azure costs", "Azure spending", "Azure bill", "cost breakdown", "cost by service", "cost by resource", "how much am I spending", "show my bill", "monthly cost summary", "cost trends", "top cost drivers", "actual cost", "amortized cost", "forecast spending", "projected costs", "estimate bill", "future costs", "budget forecast", "end of month costs", "how much will I spend", "optimize costs", "reduce spending", "find cost savings", "orphaned resources", "rightsize VMs", "cost analysis", "reduce waste", "unused resources", "optimize Redis costs", "cost by tag", "cost by resource group", "AKS cost analysis add-on", "namespace cost", "cost spike", "anomaly", "budget alert", "AKS cost visibility". DO NOT USE FOR: deploying resources, provisioning infrastructure, diagnostics, security audits, or estimating costs for new resources not yet deployed.
npx skillsauth add microsoft/skills azure-costInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Unified skill for all Azure cost management tasks: querying historical costs, forecasting future spending, and optimizing to reduce waste.
Activate this skill when user wants to:
| 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 |
| 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.
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 | 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.
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
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
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
az costmanagement query)ClientType: GitHubCopilotForAzure header on all Cost Management API requests (--headers "ClientType=GitHubCopilotForAzure" in az rest)x-ms-ratelimit-microsoft.costmanagement-*-retry-after headers (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.az rest with JSON body, not az costmanagement querytools
KQL language expertise for writing correct, efficient Kusto Query Language queries. Covers syntax gotchas, join patterns, dynamic types, datetime pitfalls, regex patterns, serialization, memory management, result-size discipline, and advanced functions (geo, vector, graph). USE THIS SKILL whenever writing, debugging, or reviewing KQL queries — even simple ones — because the gotchas section prevents the most common errors that waste tool calls and cause expensive retry cascades. Trigger on: KQL, Kusto, ADX, Azure Data Explorer, Fabric Real-Time Intelligence, EventHouse, Log Analytics, log analysis, data exploration, time series, anomaly detection, summarize, where clause, join, extend, project, let statement, parse operator, extract function, any mention of pipe-forward query syntax.
development
Deploy, evaluate, and manage Foundry agents end-to-end: Docker build, ACR push, hosted/prompt agent create, container start, batch eval, prompt optimization, prompt optimizer workflows, agent.yaml, dataset curation from traces. USE FOR: deploy agent to Foundry, hosted agent, create agent, invoke agent, evaluate agent, run batch eval, optimize prompt, improve prompt, prompt optimization, prompt optimizer, improve agent instructions, optimize agent instructions, optimize system prompt, deploy model, Foundry project, RBAC, role assignment, permissions, quota, capacity, region, troubleshoot agent, deployment failure, create dataset from traces, dataset versioning, eval trending, create AI Services, Cognitive Services, create Foundry resource, provision resource, knowledge index, agent monitoring, customize deployment, onboard, availability. DO NOT USE FOR: Azure Functions, App Service, general Azure deploy (use azure-deploy), general Azure prep (use azure-prepare).
testing
Pre-deployment validation for Azure readiness. Run deep checks on configuration, infrastructure (Bicep or Terraform), RBAC role assignments, managed identity permissions, and prerequisites before deploying. WHEN: validate my app, check deployment readiness, run preflight checks, verify configuration, check if ready to deploy, validate azure.yaml, validate Bicep, test before deploying, troubleshoot deployment errors, validate Azure Functions, validate function app, validate serverless deployment, verify RBAC roles, check role assignments, review managed identity permissions, what-if analysis, validate Container Apps deployment.
testing
Check/manage Azure quotas and usage across providers. For deployment planning, capacity validation, region selection. WHEN: "check quotas", "service limits", "current usage", "request quota increase", "quota exceeded", "validate capacity", "regional availability", "provisioning limits", "vCPU limit", "how many vCPUs available in my subscription".