Guide · Agent skill
How to use the Azure Cost Optimizer agent skill (az-cost-optimize)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The az-cost-optimize skill is a set of written instructions that an AI agent follows to review the cost of an Azure app. It reads your infrastructure-as-code files and the Azure resources in a resource group, suggests cheaper configurations, and, once you approve, files one GitHub issue per optimization plus an EPIC issue to track the work. This guide explains what the skill does, how to install it, how to ask for it, and what it needs before it can run.
Quick start
- 1Download and unzip the skill. Download the ZIP from this page and unzip it so that SKILL.md sits in a folder named az-cost-optimize.
- 2Place the folder. Copy the folder into ~/.claude/skills/ for personal use, into .claude/skills/ inside a project, or upload the ZIP under Settings → Capabilities → Skills in the Claude apps.
- 3Connect the MCP servers. Configure and authenticate the Azure MCP server and the GitHub MCP server, and make sure the Azure CLI is available as a fallback.
- 4Confirm the project has IaC files. Check that Bicep, Terraform or ARM template files are in the repository, and that the Azure resources are deployed.
- 5Make a natural request. Ask the agent to review Azure costs for the app or a named resource group.
- 6Review the summary. Check the savings, risk and effort for each recommendation shown in the summary.
- 7Approve or stop. Reply yes only if you want the individual issues and the EPIC issue created in the target repository.
What is an agent skill and what does this one do?
An agent skill is a folder containing a SKILL.md file with instructions that an AI agent loads when a task matches the skill's description. The az-cost-optimize skill is defined by a single SKILL.md file.
When the skill runs, the agent follows a multi-step workflow. It first retrieves cost optimization best practices through the Azure MCP server. It then discovers subscriptions, resource groups and resources, and searches for IaC files such as Bicep or Terraform. It collects usage metrics from Log Analytics where available, estimates current monthly costs, and generates recommendations such as right-sizing, switching pricing tiers, or adding storage lifecycle policies.
- Reads IaC files (for example *.bicep, *.tf and ARM templates) and compares them with deployed resources.
- Pulls utilization data from Log Analytics workspaces where they exist.
- Lists candidate optimizations with estimated monthly savings, risk level and implementation effort.
- Stops and asks for approval before creating any GitHub issues.
Install the az-cost-optimize skill
Download the ZIP for this skill from this page and unzip it. The skill is a single file, SKILL.md. Put the unzipped folder in one of these locations:
- Personal use across projects: ~/.claude/skills/
- Only one project: the .claude/skills/ folder inside that project
- Claude apps: upload the ZIP under Settings → Capabilities → Skills
Check the requirements before you run it
The skill depends on two MCP servers and an Azure CLI fallback. Both MCP servers must be configured and authenticated before the agent starts, and the repository where issues will be created must be accessible through GitHub MCP. The Azure resources must already be deployed, and your project should contain IaC files.
- Azure MCP server, configured and authenticated
- GitHub MCP server, configured and authenticated
- Azure CLI, used as a fallback for resource types without an MCP tool
- Access to a target GitHub repository
- Azure resources deployed, with IaC files present
Trigger the skill with a natural request
You do not need a special command. Describe what you want in plain language from inside a project that contains your IaC files and that has the required servers connected. The skill's description covers analyzing Azure resources used in the app, whether from IaC files, from resources in a target resource group, or both, and creating GitHub issues for optimizations.
Name the resource group or repository if the agent needs them, and say whether you want issues created or only a review.
- "Review the Azure costs for this app and suggest cheaper settings."
- "Analyze the resources in resource group rg-web-prod against our Bicep files and find savings."
- "Run the Azure cost optimizer on this repo and show me the summary before creating any issues."
- "Find over-provisioned Cosmos DB and storage accounts in our Terraform setup."
Review the summary and approve the issues
Before anything is filed, the skill shows an optimization summary. It lists the total resources analyzed, the current monthly cost, the potential monthly savings, the number of opportunities and how many are high priority. Each recommendation shows the current configuration, the target configuration, the savings, the risk level and the implementation effort.
The skill then asks whether to proceed. Only a confirmed yes leads to issue creation. Read the savings figures critically: the skill notes that savings calculations must be validated, so check the pricing and the metrics behind each number before you act on it.
Safety notes: scripts and network access
This skill does not run scripts. It does use the network. The workflow calls Azure through MCP tools and Azure CLI commands, reads metrics from Log Analytics, looks up pricing at the Azure pricing page, and creates GitHub issues through the GitHub MCP server.
The skill recommends and files issues. It does not apply changes to live resources. Any change to a resource or a pricing decision still needs a human review. Also note that the skill is designed to use only IaC files from the repository as its source of truth; other files are not meant to be used for analysis.
- No scripts are run by the skill.
- Network access is used for Azure, GitHub and pricing lookups.
- Review every proposed issue and savings estimate before acting on it.
Tips for better results
The quality of the output depends on the inputs. IaC files that match what is deployed give the best comparison. Log Analytics data gives the agent real utilization figures to work from; without it, the right-sizing advice is weaker.
- Keep your Bicep or Terraform files in the repository before you start.
- Scope the request to one resource group to keep the analysis manageable.
- If the agent reports no IaC files found, it has stopped by design. Add the files or point it at the right folder.
- Ask for the summary first if you want to decide which issues to create.
What people use it for
- Finding over-sized App Service Plans or Function Apps that could move to a cheaper tier or plan.
- Comparing Cosmos DB throughput settings in Bicep or Terraform with recent request charges.
- Identifying storage accounts that could use lifecycle policies to move data from Hot to Cool or Archive.
- Turning a cost review into trackable GitHub issues with one EPIC issue to coordinate the work.
Frequently asked questions
How do I install the az-cost-optimize skill?
Download the ZIP from this page and unzip it. Place the folder in ~/.claude/skills/ for personal use, or in a project's .claude/skills/ folder. In the Claude apps, you can upload the ZIP under Settings → Capabilities → Skills.
Is the Azure Cost Optimizer skill free to use?
The skill is released under the MIT licence, as listed for this item. Azure and GitHub usage, and any MCP servers you run, are separate and may have their own costs or terms.
What do I need before the skill will run?
You need the Azure MCP server and the GitHub MCP server configured and authenticated, the Azure CLI available as a fallback, access to a target GitHub repository, deployed Azure resources, and IaC files in the project.
Why does the skill say it cannot run without IaC files?
The workflow is designed to compare IaC files with deployed resources. If it finds no IaC files, it stops and reports that none were found, so it cannot complete its analysis.
Does the skill change my Azure resources automatically?
No. It recommends optimizations and, after you confirm, creates GitHub issues. Changes to live resources still need human review, and the savings figures must be validated before you act on them.
How is this different from just asking an AI to look at my Azure bill?
This skill follows a fixed workflow: it checks best practices, reads IaC files, collects usage metrics, calculates savings with a stated priority score, and files tracked GitHub issues only after approval. A general request does not guarantee those steps.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
This skill suits developers and teams who maintain an Azure app with IaC files and already use the Azure MCP and GitHub MCP servers, and who want cost reviews tracked as GitHub issues. It is not suited to projects without IaC files, or to anyone who wants savings applied automatically, since it only recommends and files issues.
Download the skill