az-cost-optimize
Makes your agent analyze and optimize Azure resource costs. It identifies savings opportunities and creates tasks for improvements.
What it does
This tool analyzes your Azure cloud resources to find ways to save money. It suggests adjustments and creates tasks so you can implement improvements.
When to use it
- ✓When you want to reduce your monthly Azure bill.
- ✓Before deploying new resources to ensure they are efficient.
- ✓When reviewing resource usage to identify waste.
Example of what to ask your AI
“Analyze my Azure resources and suggest cost optimizations, creating GitHub issues.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
The tool checks your Azure resources and configuration files, compares them with best practices and usage data to identify savings opportunities. It then creates detailed tasks to implement these savings.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add github/awesome-copilot --skill az-cost-optimizeOr download just the file:
curl -L https://raw.githubusercontent.com/github/awesome-copilot/main/skills/az-cost-optimize/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from 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-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:
…
FAQ
What are 'IaC files'?
IaC stands for 'Infrastructure as Code'. These are files that describe how your cloud resources should be configured, much like programming code.
What are 'Azure resources'?
These are the services you use in Microsoft's Azure cloud, such as virtual machines, databases, storage, etc.
What are 'GitHub issues'?
These are tasks or problems that can be created and tracked within a GitHub project. The tool creates these tasks for you to implement the suggested savings.
Details
Original description by the author
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
Popularity
- GitHub stars
- 40k
- Ranking position
- #5020
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
acquire-codebase-knowledge
Helps your agent understand and document an existing code project. It's useful for onboarding new people or getting an overview of the architecture.
github/awesome-copilot
acreadiness-assess
Enables your agent to assess a project's readiness for AI and generate a report. It's useful for understanding how well a project is prepared to use AI tools.
github/awesome-copilot
acreadiness-generate-instructions
Helps your agent create instructions for AI tools based on an assessment. It's useful for improving how AI interacts with code and closing identified gaps.
github/awesome-copilot
acreadiness-policy
Enables your agent to help define or apply policies for AI project assessment. It's useful for standardizing how projects are evaluated and ensuring compliance.
github/awesome-copilot
Similar skills
bun-runtime
Has your agent use Bun to run, organize, and test code. It helps choose Bun over other tools and migrate existing projects.
affaan-m/ECC
database-migrations
Helps your agent make safe changes to databases. It ensures changes can be undone and minimizes downtime.
affaan-m/ECC
deployment-patterns
Sets up deployment and CI/CD workflows, containerization, and rollback strategies to ensure safe releases.
affaan-m/ECC