Cost Analysis
MicrosoftOfficialCreated by Microsoft
- Skill
- Research and analysis
- Cloud and DevOps
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The cost-analysis skill provides a structured approach to investigating historical Azure billing data. It focuses on identifying cost drivers, explaining anomalies, and breaking down expenditures for specific services like Azure Kubernetes Service (AKS) and AI models. The skill emphasizes using official billing dimensions and resource graphs to provide evidence-based reports while strictly avoiding speculative tasks like forecasting, pricing estimates, or rightsizing recommendations.
What it does
- Queries historical Azure spend by scope, period, and currency.
- Investigates cost spikes and unexpected charges using billing dimensions.
- Analyzes AKS cluster and namespace cost allocation.
- Breaks down AI service and model-related costs.
- Correlates billing data with operational evidence from Resource Graph.
- Distinguishes between measured costs and inferred causes.
When to use it
- When you need a breakdown of your current Azure bill.
- When investigating a sudden cost spike or unexpected charge.
- When analyzing the cost distribution across AKS namespaces.
- When identifying the most expensive resources in your subscription.
- When correlating AI service spend with specific resource usage.
Advantages
- Provides evidence-based analysis using official billing data.
- Maintains clear separation between measured costs and inferred contributors.
- Standardizes the investigation process for AKS and AI service costs.
- Prevents speculative errors by excluding forecasting and rightsizing.
Usage examples
- “Why did my Azure bill increase last month?”
- The agent will query historical cost data for the specified period, identify the primary service or resource contributors to the increase, and report the findings.
- “Show me the cost breakdown for my AKS namespaces.”
- The agent will use the AKS cost analysis workflow to retrieve and present the cost allocation per namespace, including idle or unallocated charges.
- “What are the most expensive resources in my subscription?”
- The agent will perform a cost query grouped by resource to identify and list the top contributors to your current Azure spend.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/microsoft/cost-analysis/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip cost-analysis.zip -d .agents/skills
Documentation by Microsoft
Azure Cost Analysis
Quick Reference
| Intent | Workflow | Primary tools |
|---|---|---|
| Query historical spend | Cost query | query_costs |
| Explain a spike | Cost investigation | query_costs, Resource Graph |
| Analyze AKS spend | AKS cost analysis | query_aks_costs, Resource Graph |
| Analyze AI service spend | AI cost analysis | query_costs |
When to Use This Skill
Use for spend, anomalies, and AKS or AI allocation.
MCP Tools
Use cost tools and Resource Graph first. If an operation is unavailable, follow fallback and safety.
Workflow
Confirm scope, period, currency, and breakdown.
Load only the matching workflow above.
Never transform MCP results in a shell or interpreter; request tool-side totals, grouping, sorting, or bounded follow-up queries.
Respect row limits and label incomplete data.
Separate measured cost from inferred causes and recommendations.
Error Handling
| Error | Action |
|---|---|
| Access denied | Name the required scope and role. |
| Empty result | Distinguish no data from unavailable data. |
| Multiple currencies | Report each currency separately. |
| Server error | Retry once; then stop with the trace ID. |
Files
- ATTRIBUTION.mdAdded by AutoGineer965 B
- LICENSELicence file added by AutoGineer1.1 KiB
- SKILL.md1.9 KiB
- references/ai-cost-analysis.md2.1 KiB
- references/aks-anomaly.md4.5 KiB
- references/aks-cost-analysis.md1.5 KiB
- references/aks-enablement.md1.4 KiB
- references/cost-investigation.md3.2 KiB
- references/cost-query/dimensions-by-scope.md1.5 KiB
- references/cost-query/error-handling.md1.5 KiB
- references/cost-query/examples.md1.2 KiB
- references/cost-query/guardrails.md1.7 KiB
- references/cost-query/request-body-schema.md1.4 KiB
- references/cost-query/workflow.md2.6 KiB
- references/tools-and-safety.md2.2 KiB
references/aks-anomaly.md
Azure Kubernetes Service (AKS) Cost and Utilization Anomalies
Detect unexplained AKS cost changes or investigate a supplied cluster or namespace window. Keep billed-cost evidence separate from operational signals.
Choose Mode
| Request | Mode |
|---|---|
| Did anything unusual happen? | Detect across about 60 complete billing days |
| User supplies a date or window | Investigate that window plus 28-56 preceding days |
Confirm the cluster or namespace, timezone, and exact interval. Use only complete billing days and report each currency separately.
Collect Cost Evidence
Follow AKS cost analysis and the cost query workflow.
query_aks_costsaccepts only/subscriptions/{subscriptionId}and supports daily or monthly granularity, not hourly cost attribution.Use
query_aks_costsfor cluster or namespace allocation, keeping the same returned cost column (CostorCostUSD) and currency for the baseline and anomaly. Preserve the column, period, currency, and coverage.query_aks_costscannot report Reservation or Savings Plan charges or benefits separately by namespace; route that analysis tocost-optimization.Query cluster allocation first, then the affected cluster and namespaces. Separate real namespaces from
#idle charges#,#service charges#,#system charges#, and#unallocated charges#.For resource-level contributors such as VM scale sets, disks, networking, or monitoring, use the narrowest supported
query_costscall or approved fallback process. Use the same metric, scope, filters, and currency for both periods. Do not assign a shared workspace's full cost to one cluster.
Missing add-on data, inaccessible scopes, incomplete days, and absent rows are unavailable evidence, not zero cost.
Detect Candidate Windows
Prefer native Cost Management anomaly insights when the available tool exposes them. Otherwise compare complete daily values with comparable preceding weekdays. Derive expected and observed cost from the same operation, cost column or metric, scope, filters, and currency. Report absolute and percentage delta.
Use the anomaly score returned by native Cost Management anomaly insights when available, preserving its reported meaning and threshold. Otherwise, report the absolute and percentage difference from comparable preceding weekdays and describe the result as a candidate anomaly. For insufficient or strongly seasonal history, report the limitation instead of forcing a baseline.
Explain Contributors
Query only candidate and comparable baseline windows:
Compare namespace allocation and idle/system/service/unallocated categories.
Identify resource-level cost deltas when the available dimensions support it.
Compare workload creation and schedules, resource-request or limit changes, autoscaler decisions, disruption controls, node-local blockers, and scale-down eligibility before and during the candidate window.
Correlate scaling, upgrades, SKU, node-pool, storage, monitoring, and network changes through Resource Graph change history. Validate generated queries before execution; empty history is inconclusive.
Use historical Azure Monitor or Container Insights node count, workload, autoscaler, storage, and ingestion evidence when available.
Treat current Kubernetes metrics only as evidence that a condition persists, not as proof of a historical cause.
Distinguish verified from likely contributors, quantify attributable portions when supported, and report any material unexplained remainder.
Route Follow-up
| Finding | Handoff |
|---|---|
| Pod rightsizing, VPA, Cluster Autoscaler, or Spot configuration | azure-kubernetes when available |
| NAP readiness or node-pool fragmentation | aks-cost-optimization when available |
| PVC/PV-to-Azure storage optimization | aks-cost-optimization when available |
| Reservation or Savings Plan effect | cost-optimization |
| Namespace allocation unavailable | AKS enablement |
| Budget or alert creation | cost-governance |
Do not resize pools, change autoscaling, enable add-ons, create alerts, or modify workloads without the owning workflow's required confirmation.
Output
For each anomaly, report the period and timezone, baseline method and coverage, cost column or metric and currency, expected and observed cost, absolute and percentage delta, affected cluster/namespaces/resources, verified and likely contributors, unexplained remainder, evidence gaps, confidence, and next handoff.
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- Microsoft
- Publisher
- Microsoft (Official)
- Source
- microsoft/skills · .github/plugins/azure-cost/skills/cost-analysis · commit 0696600
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from .github/plugins/azure-cost/LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Microsoft or Microsoft.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download cost-analysis.zip