# Analyze and Optimize Azure Cloud Costs

Organizations struggle to understand and control their Azure spending. This skill provides unified cost visibility, accurate forecasting, and actionable optimization recommendations using official Azure Cost Management APIs.

## Install

```bash
npx skillstore add microsoft/azure-cost
```

## Metadata

- - Slug: microsoft-azure-cost
- - Version: 1.0.0
- - Author: Microsoft
- - GitHub username: microsoft
- - License: MIT
- - Repository: https://github.com/microsoft/azure-skills/tree/main/.github/plugins/azure-skills/skills/azure-cost/
- - Ref: main
- - Supported tools: Claude, Codex, Claude Code
- - Risk level: low
- - Risk factors: external\_commands, network
- - Quality score: 77
- - Quality tier: bronze
- - Public page: https://skillstore.pages.dev/skills/microsoft-azure-cost
- - Manifest: https://skillstore.pages.dev/api/skills/microsoft-azure-cost/manifest

## Capabilities

- Query historical Azure costs by subscription, resource group, or billing account
- Forecast future Azure spending with daily or monthly granularity
- Identify cost optimization opportunities including orphaned and underutilized resources
- Generate cost breakdown reports by service, resource, location, or tags
- Analyze AKS cluster costs and Redis cache utilization
- Validate pricing against official Azure pricing pages

## Use Cases

- Monthly Cost Review: Finance teams can query monthly cost breakdowns, identify top spending services, and generate reports for budget reconciliation and chargeback.
- Cost Optimization Initiative: DevOps engineers can identify underutilized resources, right-size VMs, find orphaned resources, and implement cost-saving recommendations.
- Budget Planning: Project managers can forecast end-of-month costs, project quarterly spending, and validate budget allocations against actual consumption trends.

## Prompt Templates

### Basic Cost Query

```
Show my Azure costs for the last 30 days broken down by service
```

### Resource Group Analysis

```
Analyze costs for resource group 'production-westus' and show the top 10 most expensive resources
```

### Cost Forecast

```
Forecast my Azure spending for the rest of this month and compare it to our budget
```

### Optimization Recommendations

```
Find cost optimization opportunities in my subscription including orphaned resources, underutilized VMs, and potential savings from rightsizing
```

## Limitations

- Requires Cost Management Reader role or higher on target Azure scopes
- Cannot deploy, provision, or modify Azure resources
- Forecast accuracy depends on having at least 28 days of historical cost data
- Does not provide security audits or diagnostic capabilities

## Best Practices

- Always query actual costs from Azure Cost Management API before making optimization decisions
- Include the total bill alongside any optimization recommendations for context
- Validate pricing from official Azure pricing pages and account for free tiers and reservations

## Anti Patterns

- Assuming costs without querying actual data from the Cost Management API
- Using incorrect date ranges - use 30 days for costs, 14 days for utilization metrics
- Executing destructive operations like resource deletion without explicit user approval and dry-run validation

## Security Audit

- - Safe to publish: true
- - Audited at: 2026-04-09T08:42:02.327\+00:00
- - Summary: Static analysis flagged 888 pattern matches \(risk score 100/100\), but evaluation confirms these are FALSE POSITIVES. The skill is documentation-based markdown files containing Azure Cost Management API usage examples. Backtick patterns are PowerShell command formatting, not shell execution. Path sequences are relative documentation links. URLs are legitimate Azure references. No malicious intent detected. Minor risk from documented CLI command examples that require Azure authentication.

## Stats

- - Views: 112
- - Downloads: 4
- - Favorites: 0
- - Popularity score: 0
