Chuyển đến nội dung
Skillpedia
Triển khai và đám mây (DevOps)40k · #7077

az-cost-optimize

Skill này làm gì

Công cụ này phân tích tài nguyên đám mây Azure của bạn để tìm cách tiết kiệm tiền. Nó gợi ý điều chỉnh và tạo tác vụ để bạn thực hiện cải thiện.

Khi nào nên dùng

  • ✓Khi bạn muốn giảm hóa đơn Azure hàng tháng.
  • ✓Trước khi triển khai tài nguyên mới để đảm bảo hiệu quả.
  • ✓Khi xem xét mức sử dụng tài nguyên để tìm sự lãng phí.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/az-cost-optimize/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Phân tích tài nguyên Azure của tôi, gợi ý cách tối ưu chi phí và tạo issue trên GitHub.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ kiểm tra tài nguyên Azure và tệp cấu hình của bạn, so sánh với thực hành tốt nhất và dữ liệu sử dụng để xác định cơ hội tiết kiệm. Sau đó, nó tạo các tác vụ chi tiết để bạn thực hiện.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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:

…

Câu hỏi thường gặp

“IaC files” là gì?

IaC là viết tắt của “Infrastructure as Code” (hạ tầng dưới dạng mã). Đó là các tệp mô tả cách tài nguyên đám mây của bạn được cấu hình, tương tự như mã lập trình.

“Tài nguyên Azure” là gì?

Đó là các dịch vụ bạn dùng trên đám mây Azure của Microsoft, như máy ảo, cơ sở dữ liệu, lưu trữ, v.v.

“GitHub issues” là gì?

Đó là các tác vụ hoặc vấn đề có thể được tạo và theo dõi trong một dự án GitHub. Công cụ tạo các tác vụ này để bạn thực hiện các biện pháp tiết kiệm được gợi ý.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7077
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự