本文へスキップ
Skillpedia
デプロイとクラウド(DevOps)40k · #7077

az-cost-optimize

できること

このツールは、Azureのクラウドリソースを分析して、コストを削減する方法を見つけます。改善案を提案し、その改善を実施できるようにタスクを作成します。

使う場面

  • ✓毎月のAzureの請求額を減らしたいとき。
  • ✓新しいリソースをデプロイする前に、効率的な構成になっているか確認したいとき。
  • ✓リソースの使用状況を見直し、無駄を見つけたいとき。

スキルのリンク

https://github.com/github/awesome-copilot/blob/main/skills/az-cost-optimize/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/github/awesome-copilot/blob/main/skills/az-cost-optimize/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のAzureリソースを分析して、コスト最適化の提案をし、GitHubのissueを作成してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールは、Azureのリソースと構成ファイルを確認し、ベストプラクティスや使用状況のデータと比較して、節約できる可能性のある箇所を見つけます。その後、節約を実現するための詳細なタスクを作成します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Azure Cost Optimize

This workflow analyzes Infrastructure-as-Code (IaC) files and Azure resources to generate cost optimization recommendations. It creates individual GitHub issues for each optimization opportunity plus one EPIC issue to coordinate implementation, enabling efficient tracking and execution of cost savings initiatives.

Prerequisites

  • Azure MCP server configured and authenticated
  • GitHub MCP server configured and authenticated
  • Target GitHub repository identified
  • Azure resources deployed (IaC files optional but helpful)
  • Prefer Azure MCP tools (azmcp-*) over direct Azure CLI when available

Workflow Steps

Step 1: Get Azure Best Practices

Action: Retrieve cost optimization best practices before analysis Tools: Azure MCP best practices tool Process:

  1. Load Best Practices:
    • Execute azmcp-bestpractices-get to get some of the latest Azure optimization guidelines. This may not cover all scenarios but provides a foundation.
    • Use these practices to inform subsequent analysis and recommendations as much as possible
    • Reference best practices in optimization recommendations, either from the MCP tool output or general Azure documentation

Step 2: Discover Azure Infrastructure

Action: Dynamically discover and analyze Azure resources and configurations Tools: Azure MCP tools + Azure CLI fallback + Local file system access Process:

  1. Resource Discovery:

    • Execute azmcp-subscription-list to find available subscriptions
    • Execute azmcp-group-list --subscription <subscription-id> to find resource groups
    • Get a list of all resources in the relevant group(s):
      • Use az resource list --subscription <id> --resource-group <name>
    • For each resource type, use MCP tools first if possible, then CLI fallback:
      • azmcp-cosmos-account-list --subscription <id> - Cosmos DB accounts
      • azmcp-storage-account-list --subscription <id> - Storage accounts
      • azmcp-monitor-workspace-list --subscription <id> - Log Analytics workspaces
      • azmcp-keyvault-key-list - Key Vaults
      • az webapp list - Web Apps (fallback - no MCP tool available)
      • az appservice plan list - App Service Plans (fallback)
      • az functionapp list - Function Apps (fallback)
      • az sql server list - SQL Servers (fallback)
      • az redis list - Redis Cache (fallback)
      • ... and so on for other resource types
  2. IaC Detection:

    • Use file_search to scan for IaC files: "/*.bicep", "/*.tf", "/main.json", "/template.json"
    • Parse resource definitions to understand intended configurations
    • Compare against discovered resources to identify discrepancies
    • Note presence of IaC files for implementation recommendations later on
    • Do NOT use any other file from the repository, only IaC files. Using other files is NOT allowed as it is not a source of truth.
    • If you do not find IaC files, then STOP and report no IaC files found to the user.
  3. Configuration Analysis:

    • Extract current SKUs, tiers, and settings for each resource
    • Identify resource relationships and dependencies
    • Map resource utilization patterns where available

Step 3: Collect Usage Metrics & Validate Current Costs

Action: Gather utilization data AND verify actual resource costs Tools: Azure MCP monitoring tools + Azure CLI Process:

  1. Find Monitoring Sources:

    • Use azmcp-monitor-workspace-list --subscription <id> to find Log Analytics workspaces
    • Use azmcp-monitor-table-list --subscription <id> --workspace <name> --table-type "CustomLog" to discover available data
  2. Execute Usage Queries:

    • Use azmcp-monitor-log-query with these predefined queries:
      • Query: "recent" for recent activity patterns
      • Query: "errors" for error-level logs indicating issues
    • For custom analysis, use KQL queries:
    // CPU utilization for App Services
    AppServiceAppLogs
    | where TimeGenerated > ago(7d)
    | summarize avg(CpuTime) by Resource, bin(TimeGenerated, 1h)
    
    // Cosmos DB RU consumption  
    AzureDiagnostics
    | where ResourceProvider == "MICROSOFT.DOCUMENTDB"
    | where TimeGenerated > ago(7d)
    | summarize avg(RequestCharge) by Resource
    
    // Storage account access patterns
    StorageBlobLogs
    | where TimeGenerated > ago(7d)
    | summarize RequestCount=count() by AccountName, bin(TimeGenerated, 1d)
    
  3. Calculate Baseline Metrics:

…

よくある質問

「IaCファイル」とは何ですか?

IaCは「Infrastructure as Code(コードとしてのインフラ)」の略です。クラウドリソースをどのように構成するかを記述したファイルで、プログラムのコードに似ています。

「Azureリソース」とは何ですか?

Microsoft のクラウドサービスであるAzureで使う各種サービスのことです。仮想マシン、データベース、ストレージなどが含まれます。

「GitHub issue」とは何ですか?

GitHubのプロジェクト内で作成・追跡できるタスクや問題のことです。ツールは、提案された節約策を実施するためのタスクを作成します。

詳細

作者による元の説明

Analyze Azure resources used in the app (IaC files and/or resources in a target rg) and optimize costs - creating GitHub issues for identified optimizations.

repo: github/awesome-copilot

人気

GitHubのスター
40k
ランキング
#7077
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル