azure-cost-optimization

Analyze Azure subscriptions to identify cost savings and generate prioritized optimization recommendations.

Updated Jan 23, 2026
One-click install
npx skills add https://github.com/stephschofield/beth --skill azure-cost-optimization-stephschofield
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: azure-cost-optimization
Source: https://github.com/stephschofield/beth/tree/main/.github/skills/azure-cost-optimization
Command: npx skills add https://github.com/stephschofield/beth --skill azure-cost-optimization-stephschofield

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Azure subscriptions accumulate orphaned resources, oversized SKUs, and untagged assets that silently inflate monthly bills, and manually auditing costs across subscriptions is slow and error-prone. ## Core Features & Use Cases - Orphaned Resource Detection: Uses Azure Quick Review (azqr) and Azure Resource Graph KQL queries to find unattached disks, idle NICs, unused public IPs, and empty load balancers. - Actual Cost Analysis: Queries the Azure Cost Management API for real 30-day spend per resource, validates pricing against official Azure pricing pages, and collects 14-day utilization metrics from Azure Monitor for rightsizing decisions. - Redis-Specific Optimization: Applies prioritized rules (failed caches, Premium tier in dev, oversized caches) with pre-built report templates for subscription-level and per-cache analysis. - Use Case: Ask for a cost optimization report on a subscription and receive a Markdown report with actual costs, Azure Portal links, prioritized recommendations with estimated savings, and a JSON audit trail of all cost queries. ## Quick Start Ask the assistant to analyze my Azure subscription for cost savings and generate a cost optimization report with rightsizing recommendations.

Frequently Asked Questions about azure-cost-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find orphaned resources in my Azure subscription?▼

Run Azure Quick Review (azqr) against the subscription to detect unattached disks, unused NICs, and idle NAT gateways, or query Azure Resource Graph with KQL filters like isempty(managedBy) on disks. Cross-reference findings with Cost Management API data before deleting anything.

How to reduce Azure Redis cache costs?▼

List caches with the redis_list command and apply prioritized rules: delete failed or stuck caches, downgrade Premium tiers in dev environments to Standard, and remove old test caches. Typical savings range from $50 to $1000 per month per cache depending on the issue.

What permissions are needed to analyze Azure costs?▼

You need the Cost Management Reader role for cost queries, Monitoring Reader for utilization metrics, and Reader on the target subscription or resource group. Azure CLI must be authenticated with the costmanagement and resource-graph extensions installed.

Why does az costmanagement query fail and what is the alternative?▼

The az costmanagement query command is unreliable for complex queries. Use az rest with a POST to the Cost Management query API endpoint and a JSON body defining the ActualCost dataset grouped by ResourceId instead.

Can this skill delete or modify Azure resources automatically?▼

No, it only generates reports and recommended commands. Destructive operations require explicit user approval, and the workflow includes dry-run commands, rollback procedures, and guidance to test changes in non-production first.