az-cost-optimize skill
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.
Is the az-cost-optimize skill safe?
Clean: nothing in its files matched our rules. We read 1 file in the folder on 2026-09-28.
No findings.
Install the az-cost-optimize skill
A skill is a folder. Copy it into your agent's skills folder and the agent loads it when the task matches its description.
git clone --depth 1 https://github.com/github/awesome-copilot.git /tmp/awesome-copilot mkdir -p ~/.claude/skills cp -r /tmp/awesome-copilot/skills/az-cost-optimize ~/.claude/skills/az-cost-optimize
In the Claude apps, zip the folder and upload it from the Skills settings. The folder on GitHub
The instructions your agent would load
SKILL.md as published, without the frontmatter. Read it on 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:
- 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:
- Resource Discovery:
- Execute azmcp-subscription-list to find available subscriptions
- Execute azmcp-group-list --subscription to find resource groups
- Get a list of all resources in the relevant group(s):
- Use az resource list --subscription --resource-group
- For each resource type, use MCP tools first if possible, then CLI fallback:
- azmcp-cosmos-account-list --subscription - Cosmos DB accounts
- azmcp-storage-account-list --subscription - Storage accounts
- azmcp-monitor-workspace-list --subscription - 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)
- IaC Detection:
- Use filesearch 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.
- 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 to find Log Analytics workspaces
- Use azmcp-monitor-table-list --subscription --workspace --table-type "CustomLog" to discover available data
- 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)- 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 billing commands
- 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: createissue for each recommendation Process**:
- Create Individual Issues using this template:
Title Format: [COST-OPT] [Resource Type] - [Brief Description] - $X/month savings
Body 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]# 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/10Step 7: Create EPIC Coordinating Issue
More skills from github/awesome-copilot
- Aacquire-codebase-knowledgeUse this skill when the user explicitly asks to map, document, or onboard into an existing codebase. Trigger for prompts like "map this codebase", "document this architecture", "onboard me to this repo", or "create codebase docs". Do not trigger for routine feature implementation, bug fixes, or narrow code edits unless the user asks for repository-level discovery.
- Aacreadiness-assessRun the AgentRC readiness assessment on the current repository and produce a static HTML dashboard at reports/index.html. Wraps `npx github:microsoft/agentrc readiness` and hands off rendering to the @ai-readiness-reporter custom agent. Supports policies (--policy) for org-specific scoring. Use when asked to assess, audit, or score the AI readiness of a repo.
- Aacreadiness-generate-instructionsGenerate tailored AI agent instruction files via AgentRC instructions command. Produces .github/copilot-instructions.md (default, recommended for Copilot in VS Code) plus optional per-area .instructions.md files with applyTo globs for monorepos. Use after running /acreadiness-assess to close gaps in the AI Tooling pillar.
- Aacreadiness-policyHelp the user pick, write, or apply an AgentRC policy. Policies customise readiness scoring by disabling irrelevant checks, overriding impact/level, setting pass-rate thresholds, or chaining org baselines with team overrides. Use when the user asks about strict mode, AI-only scoring, custom weights, CI gating, or wants org-wide standardisation.
- Aad-campaign-analyzerUse this skill when the user shares ad campaign performance data and asks what to cut, scale, or test. Trigger for prompts like "analyze my ad campaigns", "where am I wasting ad spend", "reallocate my ad budget", "which ads are actually working", or "ROAS analysis". Do not trigger for campaign planning or creative generation without performance data.
- Aadd-educational-commentsAdd educational comments to the file specified, or prompt asking for file to comment if one is not provided.
- Aadobe-illustrator-scriptingWrite, debug, and optimize Adobe Illustrator automation scripts using ExtendScript (JavaScript/JSX). Use when creating or modifying scripts that manipulate documents, layers, paths, text frames, colors, symbols, artboards, or any Illustrator DOM objects. Covers the complete JavaScript object model, coordinate system, measurement units, export workflows, and scripting best practices.
- Aagent-architectureDesign AI agent architectures through requirements discovery, or audit and diagnose architectural flaws in existing agents. Architecture only; excludes implementation and general code review.
- Aagent-governancePatterns and techniques for adding governance, safety, and trust controls to AI agent systems. Use this skill when: - Building AI agents that call external tools (APIs, databases, file systems) - Implementing policy-based access controls for agent tool usage - Adding semantic intent classification to detect dangerous prompts - Creating trust scoring systems for multi-agent workflows - Building audit trails for agent actions and decisions - Enforcing rate limits, content filters, or tool restrictions on agents - Working with any agent framework (PydanticAI, CrewAI, OpenAI Agents, LangChain, AutoGen)
- Aagent-owasp-complianceCheck any AI agent codebase against the OWASP Agentic Security Initiative (ASI) Top 10 risks. Use this skill when: - Evaluating an agent system's security posture before production deployment - Running a compliance check against OWASP ASI 2026 standards - Mapping existing security controls to the 10 agentic risks - Generating a compliance report for security review or audit - Comparing agent framework security features against the standard - Any request like "is my agent OWASP compliant?", "check ASI compliance", or "agentic security audit"
- Aagent-skill-stackFind, evaluate, and assemble the smallest compatible set of AI Agent Skills for an end-to-end natural-language goal. Use when a user wants Skills for a multi-step workflow, asks which Skills fit a project, needs an installed-Skill audit or conflict check, has low Skill recall, wants indirect helpers such as humanizers or compliance checks, or wants a project-specific Skill Stack with controlled installation. Search local Skills, registries, GitHub, and OpenCLI; compare adoption, verified fit, safety, and overlap. Do not use for locating one known or common Skill; use the generic find-skills workflow.
- Aagent-supply-chainVerify supply chain integrity for AI agent plugins, tools, and dependencies. Use this skill when: - Generating SHA-256 integrity manifests for agent plugins or tool packages - Verifying that installed plugins match their published manifests - Detecting tampered, modified, or untracked files in agent tool directories - Auditing dependency pinning and version policies for agent components - Building provenance chains for agent plugin promotion (dev → staging → production) - Any request like "verify plugin integrity", "generate manifest", "check supply chain", or "sign this plugin"