Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
microsoft avatar

Azure Cost

  • 286k installs
  • 1.3k repo stars
  • Updated July 26, 2026
  • microsoft/azure-skills

azure-cost is a Microsoft agent skill for querying Azure bills, forecasting spend, and optimizing waste via Cost Management API workflows and MCP-assisted CLI generation.

About

Azure Cost is a unified Microsoft agent skill for querying historical Azure spend, forecasting future bills, and finding optimization opportunities. It routes user intent to three workflows: cost query for breakdowns by service, resource, location, or tag; cost optimization for orphaned resources, rightsizing, and waste reduction; and cost forecast for end-of-month projections. It uses the Cost Management REST API via az rest with api-version 2023-11-01, prefers MCP tools like azure__documentation and azure__extension_cli_generate over raw CLI guessing, and requires Cost Management Reader plus Monitoring Reader roles. Guardrails mandate presenting actual queried data labeled ACTUAL DATA, validating pricing from official sources, including Azure Portal links, and never executing destructive deletes without explicit approval. Optimization workflows must show the total bill alongside savings recommendations, and sub-ten-dollar monthly costs should emphasize operational improvements over financial savings. Rate-limit handling requires honoring x-ms-ratelimit retry-after headers. Do not use for deploying resources, security audits, or estimating costs for not-yet-deployed resources.

  • Unified routing across cost query, cost optimization, and cost forecast workflows with shared scope reference.
  • Uses Cost Management REST API via az rest with ClientType GitHubCopilotForAzure header requirement.
  • Prefers MCP tools azure__documentation, azure__extension_cli_generate, and azure__get_azure_bestpractices.
  • Safety rules: no destructive deletes without approval, dry-run commands, and bill shown with optimization advice.
  • Data classification labels: ACTUAL DATA, ACTUAL METRICS, VALIDATED PRICING, and ESTIMATED SAVINGS.

Azure Cost by the numbers

  • 285,723 all-time installs (skills.sh)
  • +20,342 installs in the week ending Jul 28, 2026 (Skillselion tracking)
  • Ranked #15 of 1,041 Cloud & Infrastructure skills by installs in the Skillselion catalog
  • Security screen: LOW risk (skills.sh audit)
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

azure-cost capabilities & compatibility

Capabilities
historical cost query by service, resource, tag, · future spend forecasting via cost management for · cost optimization workflow with orphaned resourc · rightsizing recommendations with utilization met · mcp assisted az rest command generation · approval gated destructive cleanup with dry run
Works with
azure
Use cases
devops · data analysis · planning
From the docs

What azure-cost says it does

Unified skill for all Azure cost management tasks: querying historical costs, forecasting future spending, and optimizing to reduce waste.
SKILL.md
Always query actual costs first — never estimate or assume
SKILL.md
Get approval before deleting resources
SKILL.md
npx skills add https://github.com/microsoft/azure-skills --skill azure-cost

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs286k
repo stars1.3k
Security audit3 / 3 scanners passed
Last updatedJuly 26, 2026
Repositorymicrosoft/azure-skills

How do I understand my Azure bill, forecast end-of-month costs, and find savings without guessing or skipping the total spend context?

Query Azure historical costs, forecast spending, and recommend optimizations with Cost Management API workflows.

Who is it for?

Azure operators analyzing subscription or resource-group costs, forecasts, and rightsizing opportunities with API-backed data.

Skip if: Skip for deploying new infrastructure, security audits, or estimating costs of resources not yet deployed.

When should I use this skill?

User asks about Azure costs, spending, bill breakdown, forecast, optimize spending, orphaned resources, or rightsizing VMs.

What you get

Actual cost breakdowns, forecasts from queried data, and optimization recommendations with Portal links and approval-gated changes.

  • Cost breakdown reports
  • Spend forecasts
  • Optimization recommendations with Portal links

By the numbers

  • Historical cost query by service, resource, tag, and location
  • Future spend forecasting via Cost Management forecast API
  • Cost optimization workflow with orphaned resource discovery

Files

SKILL.mdMarkdownGitHub ↗

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

PropertyValue
Query API EndpointPOST {scope}/providers/Microsoft.CostManagement/query?api-version=2023-11-01
Forecast API EndpointPOST {scope}/providers/Microsoft.CostManagement/forecast?api-version=2023-11-01
MCP Toolsazure__documentation, azure__extension_cli_generate, azure__get_azure_bestpractices
CLIaz rest, az monitor metrics list, az resource list
Required RoleCost Management Reader + Monitoring Reader + Reader on scope

MCP Tools

ToolDescriptionParametersWhen to Use
azure__documentationSearch Azure documentationquery (Required): search termsResearch Cost Management API parameters and options
azure__extension_cli_generateGenerate Azure CLI commandsintent (Required): task description, cli-type (Required): "az"Construct az rest commands for cost queries
azure__get_azure_bestpracticesGet Azure best practicesintent (Required): optimization contextInform query design with cost management best practices
azure__extension_azqrRun Azure Quick Review compliance scansubscription (Required): subscription ID, resource-group (Optional): resource group nameFind orphaned resources and cost optimization opportunities
azure__aksAzure Kubernetes Service operationsvaries by sub-commandAKS 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 IntentWorkflowExample Prompts
Understand current costsCost Query Workflow"how much am I spending", "cost by service", "show my bill"
Reduce costs / find wasteCost Optimization Workflow"optimize costs", "find orphaned resources", "reduce spending"
Project future costsCost Forecast Workflow"forecast costs", "end of month estimate", "how much will I spend"
Full cost pictureAll 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)

ScopeURL 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](cost-query/workflow.md)

---

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](cost-optimization/workflow.md)

---

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](cost-forecast/workflow.md)

---

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: GitHubCopilotForAzure header on all Cost Management API requests (--headers "ClientType=GitHubCopilotForAzure" in az 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-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.

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

  • Redis Management: .NET

Guides

  • Azure Skills for Claude Code: The Complete Guide to microsoft/azure-skills

    microsoft/azure-skills is Microsoft's official repo of 27 Azure skills for Claude Code, covering deploy, AKS, diagnostics, compliance, cost, and Azure AI Foundry. Combined they have 9,775,059 installs, with microsoft-foundry alone at 446,557 installs (skills.sh registry, July 2026). This guide maps every skill to the Azure job it does.

Related skills

How it compares

azure-cost is a Microsoft agent skill for querying Azure bills, forecasting spend, and optimizing waste via Cost Management API workflows and MCP-assisted CLI generation, not a generic alternative.

FAQ

Who is azure-cost for?

Teams managing live Azure subscriptions who need queried cost data, forecasts, and optimization reports with safety guardrails.

When should I use azure-cost?

When breaking down spend by service or tag, forecasting monthly bills, or finding orphaned and unused resources to reduce waste.

Is azure-cost safe to install?

Review the Security Audits panel; destructive cleanup requires explicit user approval and dry-run validation first.

Cloud & Infrastructureinframonitoring

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.