Skip to content
Azure Cost Management

Azure Cost Management Skill

Microsoft's official Azure skill for cost work: query historical spend, forecast it, and hunt down waste like orphaned disks and oversized VMs.

GitHub Docs

Install

Install with the skills CLI

One command for Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf and dozens of other agents. Needs Node.js; the skill is fetched straight from microsoft/azure-skills.

$ npx skills add microsoft/azure-skills --skill azure-cost

Run it in a terminal. The CLI finds the agents installed on your machine, asks which ones to add the skill to, and whether to install it into the folder you ran it from or for all your projects.

Other ways to install

Copy the whole skill folder — SKILL.md and any scripts or references beside it — into ~/.claude/skills/azure-cost/, where Claude Code picks it up in every project. Only git is needed.

tmp=$(mktemp -d) && \
  git clone --depth 1 --branch main https://github.com/microsoft/azure-skills.git "$tmp" && \
  mkdir -p ~/.claude/skills && \
  cp -R "$tmp"/skills/azure-cost ~/.claude/skills/azure-cost

No scripts or references next to it? Saving the SKILL.md alone as ~/.claude/skills/azure-cost/SKILL.md works too.

Using another agent? Its personal skills folder
Codex
~/.agents/skills/
Cursor
~/.cursor/skills/
GitHub Copilot
~/.copilot/skills/
Gemini CLI
~/.gemini/skills/
Windsurf
~/.codeium/windsurf/skills/
OpenCode
~/.config/opencode/skills/

About

  • Routes between cost query, optimization and forecast workflows
  • Azure Cost Management query and forecast APIs with correct api-version
  • Handles subscription, resource group, management group and billing account scopes
  • Waste hunting: orphaned resources, VM rightsizing, AKS and storage spend
  • Service-specific playbooks for Azure Cache for Redis and Azure Storage
  • States the exact RBAC roles required before it starts

azure-cost is one of the skills in microsoft/azure-skills, Microsoft's official
agent plugin for Azure. It handles the money side of a subscription, and it is built as a router
rather than one long prompt: the skill classifies what you are asking for and then loads only the
workflow file that matches.

Three workflows

  • Cost Query — what am I spending, broken down how. Backed by

POST {scope}/providers/Microsoft.CostManagement/query.

  • Cost Optimization — where is the waste. This is the interesting one: orphaned resources,

oversized VMs, AKS spend, storage tiering, and service-specific playbooks for Azure Cache for
Redis and Azure Storage.

  • Cost Forecast — what will I spend, via the Cost Management forecast API.

Scopes. Every query runs against an explicit scope, and the skill knows all four shapes:
subscription, resource group, management group and billing account. That matters because a cost
figure without a scope is meaningless, and getting the scope string wrong is the usual reason these
API calls fail.

Permissions. Cost Management Reader plus Monitoring Reader plus Reader on the target scope. The
skill states this up front rather than letting an agent discover it through a 403.

What it deliberately does not do. Deploying or provisioning resources, diagnostics, and security
audits are other skills in the same plugin — the description tells the agent to route elsewhere for
those, which keeps it from being loaded on every Azure question.

MIT licensed, authored by Microsoft, and installable as part of the azure-skills plugin.

Try it

Once installed, ask your agent something like:

Break down last month's Azure spend for subscription X by service, then show me the three biggest sources of waste and what deleting them would save.

SKILL.md

The instructions your agent loads, as published by Microsoft.

SKILL.md
name
azure-cost
description
Azure cost management: query costs, forecast spending, optimize to reduce waste. WHEN: \"Azure costs\", \"Azure bill\", \"cost breakdown\", \"how much am I spending\", \"forecast spending\", \"optimize costs\", \"reduce spending\", \"orphaned resources\", \"rightsize VMs\", \"cost spike\", \"reduce storage costs\", \"AKS cost\". DO NOT USE FOR: deploying resources, provisioning, diagnostics, or security audits.
license
MIT
metadata
author: Microsoft version: "1.3.1"

Azure Cost Management Skill

Query historical costs, forecast future spending, optimize to reduce waste.

Routing

| User Intent | Workflow |
|-------------|----------|
| Understand current costs | [Cost Query](cost-query/workflow.md) |
| Reduce costs / find waste | [Cost Optimization](cost-optimization/workflow.md) |
| Project future costs | [Cost Forecast](cost-forecast/workflow.md) |

Quick Reference

| Property | Value |
|----------|-------|
| Query API | POST {scope}/providers/Microsoft.CostManagement/query?api-version=2023-11-01 |
| Forecast API | POST {scope}/providers/Microsoft.CostManagement/forecast?api-version=2023-11-01 |
| Required Role | Cost Management Reader + Monitoring Reader + Reader (on target scope) |

Scope Patterns
  • Subscription: /subscriptions/<id>
  • Resource Group: /subscriptions/<id>/resourceGroups/<name>
  • Management Group: /providers/Microsoft.Management/managementGroups/<id>
  • Billing Account: /providers/Microsoft.Billing/billingAccounts/<id>
Service-Specific Optimization
  • [Redis](cost-optimization/services/redis/azure-cache-for-redis.md)
  • [Storage](cost-optimization/services/storage/azure-storage.md)
References
  • [MCP Tools, Best Practices, Safety](references/tools-and-best-practices.md)
  • [SDK: Redis .NET](cost-optimization/sdk/azure-resource-manager-redis-dotnet.md)
Install
Browse all skills →