github/awesome-copilot/skills/az-cost-optimize/SKILL.md
az-cost-optimize
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.
- Source repository stars
- 37,126
- Declared platforms
- 0
- Static risk flags
- 1
- Last source update
- 2026-07-28
- Source checked
- 2026-07-28
Decision brief
What it does—and where it fits
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 ex…
Not for
- Tasks that require unconfirmed production actions or broad system permissions.
- Environments where the pinned source and install steps cannot be inspected.
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/github/awesome-copilot --skill "skills/az-cost-optimize"Inspect the Agent Skill "az-cost-optimize" from https://github.com/github/awesome-copilot/blob/9933dcad5be5caeb288cebcd370eeeb2fc2f1685/skills/az-cost-optimize/SKILL.md at commit 9933dcad5be5caeb288cebcd370eeeb2fc2f1685. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Workflow Steps
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 foun…
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 - 02
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 foun…
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 - 03
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 --subsc…
Resource Discovery:Execute azmcp-subscription-list to find available subscriptionsExecute azmcp-group-list --subscription to find resource groups - 04
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 to find Log Analytics workspaces - Use azmcp-monitor-table-list --subscription --…
Find Monitoring Sources:Use azmcp-monitor-workspace-list --subscription to find Log Analytics workspacesUse azmcp-monitor-table-list --subscription --workspace --table-type "CustomLog" to discover available data - 05
Step 4: Generate Cost Optimization Recommendations
Action: Analyze resources to identify optimization opportunities Tools: Local analysis using collected data Process: 1. Apply Optimization Patterns based on resource types found:
Apply Optimization Patterns based on resource types found:App Service Plans: Right-size based on CPU/memory usageFunction Apps: Premium → Consumption plan for low usage
Permission review
Static risk signals and limitations
Writes files
The documentation asks the agent to create, modify, or delete local files.
az deployment group create --resource-group [rg] --template-file infrastructure/bicep/main.bicepEvidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 80/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 37,126 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | automated source guide | Editorial | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- github/awesome-copilot
- Skill path
- skills/az-cost-optimize/SKILL.md
- Commit
- 9933dcad5be5caeb288cebcd370eeeb2fc2f1685
- License
- MIT
- Collected
- 2026-07-28
- Default branch
- main
View the original SKILL.md
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:
- Load Best Practices:
- Execute
azmcp-bestpractices-getto 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
- Execute
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:
-
Resource Discovery:
- Execute
azmcp-subscription-listto 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>
- Use
- For each resource type, use MCP tools first if possible, then CLI fallback:
azmcp-cosmos-account-list --subscription <id>- Cosmos DB accountsazmcp-storage-account-list --subscription <id>- Storage accountsazmcp-monitor-workspace-list --subscription <id>- Log Analytics workspacesazmcp-keyvault-key-list- Key Vaultsaz 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
- Execute
-
IaC Detection:
- Use
file_searchto 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.
- Use
-
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:
-
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
- Use
-
Execute Usage Queries:
- Use
azmcp-monitor-log-querywith 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) - Use
-
Calculate Baseline Metrics:
- CPU/Memory utilization averages
- Database throughput patterns
- Storage access frequency
- Function execution rates
-
VALIDATE CURRENT COSTS:
- Using the SKU/tier configurations discovered in Step 2
- Look up current Azure pricing at https://azure.microsoft.com/pricing/ or use
az billingcommands - Document: Resource → Current SKU → Estimated monthly cost
- Calculate realistic current monthly total before proceeding to recommendations
Step 4: Generate Cost Optimization Recommendations
Action: Analyze resources to identify optimization opportunities Tools: Local analysis using collected data Process:
-
Apply Optimization Patterns based on resource types found:
Compute Optimizations:
- App Service Plans: Right-size based on CPU/memory usage
- Function Apps: Premium → Consumption plan for low usage
- Virtual Machines: Scale down oversized instances
Database Optimizations:
- Cosmos DB:
- Provisioned → Serverless for variable workloads
- Right-size RU/s based on actual usage
- SQL Database: Right-size service tiers based on DTU usage
Storage Optimizations:
- Implement lifecycle policies (Hot → Cool → Archive)
- Consolidate redundant storage accounts
- Right-size storage tiers based on access patterns
Infrastructure Optimizations:
- Remove unused/redundant resources
- Implement auto-scaling where beneficial
- Schedule non-production environments
-
Calculate Evidence-Based Savings:
- Current validated cost → Target cost = Savings
- Document pricing source for both current and target configurations
-
Calculate Priority Score for each recommendation:
Priority Score = (Value Score × Monthly Savings) / (Risk Score × Implementation Days) High Priority: Score > 20 Medium Priority: Score 5-20 Low Priority: Score < 5 -
Validate Recommendations:
- Ensure Azure CLI commands are accurate
- Verify estimated savings calculations
- Assess implementation risks and prerequisites
- Ensure all savings calculations have supporting evidence
Step 5: User Confirmation
Action: Present summary and get approval before creating GitHub issues Process:
-
Display Optimization Summary:
🎯 Azure Cost Optimization Summary 📊 Analysis Results: • Total Resources Analyzed: X • Current Monthly Cost: $X • Potential Monthly Savings: $Y • Optimization Opportunities: Z • High Priority Items: N 🏆 Recommendations: 1. [Resource]: [Current SKU] → [Target SKU] = $X/month savings - [Risk Level] | [Implementation Effort] 2. [Resource]: [Current Config] → [Target Config] = $Y/month savings - [Risk Level] | [Implementation Effort] 3. [Resource]: [Current Config] → [Target Config] = $Z/month savings - [Risk Level] | [Implementation Effort] ... and so on 💡 This will create: • Y individual GitHub issues (one per optimization) • 1 EPIC issue to coordinate implementation ❓ Proceed with creating GitHub issues? (y/n) -
Wait for User Confirmation: Only proceed if user confirms
Step 6: Create Individual Optimization Issues
Action: Create separate GitHub issues for each optimization opportunity. Label them with "cost-optimization" (green color), "azure" (blue color).
MCP Tools Required: create_issue for each recommendation
Process:
-
Create Individual Issues using this template:
Title Format:
[COST-OPT] [Resource Type] - [Brief Description] - $X/month savingsBody Template:
## 💰 Cost Optimization: [Brief Title] **Monthly Savings**: $X | **Risk Level**: [Low/Medium/High] | **Implementation Effort**: X days ### 📋 Description [Clear explanation of the optimization and why it's needed] ### 🔧 Implementation **IaC Files Detected**: [Yes/No - based on file_search results] ```bash # If IaC files found: Show IaC modifications + deployment # File: infrastructure/bicep/modules/app-service.bicep # Change: sku.name: 'S3' → 'B2' az deployment group create --resource-group [rg] --template-file infrastructure/bicep/main.bicep # If no IaC files: Direct Azure CLI commands + warning # ⚠️ No IaC files found. If they exist elsewhere, modify those instead. az appservice plan update --name [plan] --sku B2📊 Evidence
- Current Configuration: [details]
- Usage Pattern: [evidence from monitoring data]
- Cost Impact: $X/month → $Y/month
- Best Practice Alignment: [reference to Azure best practices if applicable]
✅ Validation Steps
- Test in non-production environment
- Verify no performance degradation
- Confirm cost reduction in Azure Cost Management
- Update monitoring and alerts if needed
⚠️ Risks & Considerations
- [Risk 1 and mitigation]
- [Risk 2 and mitigation]
Priority Score: X | Value: X/10 | Risk: X/10
Step 7: Create EPIC Coordinating Issue
Action: Create master issue to track all optimization work. Label it with "cost-optimization" (green color), "azure" (blue color), and "epic" (purple color).
MCP Tools Required: create_issue for EPIC
Note about mermaid diagrams: Ensure you verify mermaid syntax is correct and create the diagrams taking accessibility guidelines into account (styling, colors, etc.).
Process:
-
Create EPIC Issue:
Title:
[EPIC] Azure Cost Optimization Initiative - $X/month potential savingsBody Template:
# 🎯 Azure Cost Optimization EPIC **Total Potential Savings**: $X/month | **Implementation Timeline**: X weeks ## 📊 Executive Summary - **Resources Analyzed**: X - **Optimization Opportunities**: Y - **Total Monthly Savings Potential**: $X - **High Priority Items**: N ## 🏗️ Current Architecture Overview ```mermaid graph TB subgraph "Resource Group: [name]" [Generated architecture diagram showing current resources and costs] end📋 Implementation Tracking
🚀 High Priority (Implement First)
- #[issue-number]: [Title] - $X/month savings
- #[issue-number]: [Title] - $X/month savings
⚡ Medium Priority
- #[issue-number]: [Title] - $X/month savings
- #[issue-number]: [Title] - $X/month savings
🔄 Low Priority (Nice to Have)
- #[issue-number]: [Title] - $X/month savings
📈 Progress Tracking
- Completed: 0 of Y optimizations
- Savings Realized: $0 of $X/month
- Implementation Status: Not Started
🎯 Success Criteria
- All high-priority optimizations implemented
- >80% of estimated savings realized
- No performance degradation observed
- Cost monitoring dashboard updated
📝 Notes
- Review and update this EPIC as issues are completed
- Monitor actual vs. estimated savings
- Consider scheduling regular cost optimization reviews
Error Handling
- Cost Validation: If savings estimates lack supporting evidence or seem inconsistent with Azure pricing, re-verify configurations and pricing sources before proceeding
- Azure Authentication Failure: Provide manual Azure CLI setup steps
- No Resources Found: Create informational issue about Azure resource deployment
- GitHub Creation Failure: Output formatted recommendations to console
- Insufficient Usage Data: Note limitations and provide configuration-based recommendations only
Success Criteria
- ✅ All cost estimates verified against actual resource configurations and Azure pricing
- ✅ Individual issues created for each optimization (trackable and assignable)
- ✅ EPIC issue provides comprehensive coordination and tracking
- ✅ All recommendations include specific, executable Azure CLI commands
- ✅ Priority scoring enables ROI-focused implementation
- ✅ Architecture diagram accurately represents current state
- ✅ User confirmation prevents unwanted issue creation
Alternatives
Compare before choosing
event4u-app/agent-config
design-review
Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.
K-Dense-AI/scientific-agent-skills
dask
Distributed computing for larger-than-RAM pandas/NumPy workflows. Use when you need to scale existing pandas/NumPy code beyond memory or across clusters. Best for parallel file processing, distributed ML, integration with existing pandas code. For out-of-core analytics on single machine use vaex; for in-memory speed use polars.
K-Dense-AI/scientific-agent-skills
neurokit2
Use NeuroKit2 to build or audit reproducible research workflows for physiological time-series preprocessing, event/interval analysis, multimodal alignment, variability, and complexity. Trigger when code imports neurokit2 or needs its current APIs, schemas, and method-aware validation—not for diagnosis or device validation.
K-Dense-AI/scientific-agent-skills
biopython
Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.