Skill 寫法圖鑑

cost-analysis

Microsoft | 雲端與基礎設施 | 原文 | MIT

分析 Azure 實際支出、帳單暴增,以及 AKS 與 AI 成本

中文翻譯

---
name: cost-analysis
description: "分析 Azure 實際支出、帳單變化,以及 AKS 或 AI 的成本。WHEN: \"Azure cost breakdown\", \"most expensive resources\", \"why did my bill increase\", \"cost spike\", \"unexpected charge\", \"Cosmos DB charges\", \"Foundry model costs\", \"AKS cluster cost\", \"namespace cost\", \"enable AKS cost analysis\", \"idle AKS capacity\". DO NOT USE FOR: forecasts, pricing estimates, rightsizing, commitments, or budgets."
license: MIT
metadata:
  author: Microsoft
  version: "1.1.2"
---

# Azure Cost Analysis

## Quick Reference

| Intent | Workflow | Primary tools |
|--------|----------|---------------|
| 查詢歷史支出 | [Cost query](references/cost-query/workflow.md) | `query_costs` |
| 解釋成本暴增 | [Cost investigation](references/cost-investigation.md) | `query_costs`, Resource Graph |
| 分析 AKS 支出 | [AKS cost analysis](references/aks-cost-analysis.md) | `query_aks_costs`, Resource Graph |
| 分析 AI 服務支出 | [AI cost analysis](references/ai-cost-analysis.md) | `query_costs` |

## When to Use This Skill

用在支出、異常,以及 AKS 或 AI 的成本分攤。

## MCP Tools

先用成本工具和 Resource Graph。如果某個操作不能用,照
[fallback and safety](references/tools-and-safety.md) 處理。

## Workflow

1. 確認範圍、期間、幣別和拆分方式。
2. 只載入上面對應的那個 workflow。
3. 絕對不要在 shell 或 interpreter 裡轉換 MCP 的結果;要總計、分組、
   排序或有範圍限制的後續查詢,請在工具那邊做。
4. 遵守資料列上限,資料不完整要標示出來。
5. 把實測成本、推論出來的原因和建議分開講。

## Error Handling

| Error | Action |
|-------|--------|
| Access denied | 說出需要哪個 scope 和角色。 |
| Empty result | 區分「沒有資料」和「資料拿不到」。 |
| Multiple currencies | 每種幣別分開回報。 |
| Server error | 重試一次;還是失敗就停下來,附上 trace ID。 |

英文原文

---
name: cost-analysis
description: "Analyze actual Azure spend, bill changes, and AKS or AI costs. WHEN: \"Azure cost breakdown\", \"most expensive resources\", \"why did my bill increase\", \"cost spike\", \"unexpected charge\", \"Cosmos DB charges\", \"Foundry model costs\", \"AKS cluster cost\", \"namespace cost\", \"enable AKS cost analysis\", \"idle AKS capacity\". DO NOT USE FOR: forecasts, pricing estimates, rightsizing, commitments, or budgets."
license: MIT
metadata:
  author: Microsoft
  version: "1.1.2"
---

# Azure Cost Analysis

## Quick Reference

| Intent | Workflow | Primary tools |
|--------|----------|---------------|
| Query historical spend | [Cost query](references/cost-query/workflow.md) | `query_costs` |
| Explain a spike | [Cost investigation](references/cost-investigation.md) | `query_costs`, Resource Graph |
| Analyze AKS spend | [AKS cost analysis](references/aks-cost-analysis.md) | `query_aks_costs`, Resource Graph |
| Analyze AI service spend | [AI cost analysis](references/ai-cost-analysis.md) | `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](references/tools-and-safety.md).

## Workflow

1. Confirm scope, period, currency, and breakdown.
2. Load only the matching workflow above.
3. Never transform MCP results in a shell or interpreter; request tool-side
   totals, grouping, sorting, or bounded follow-up queries.
4. Respect row limits and label incomplete data.
5. 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. |