applying-azure-cost-guardrailslisted
Install: claude install-skill alexpizarro/azure-lean-stack-skills
# Applying Azure Cost Guardrails
Consumption-first design defaults + a script that audits existing Bicep for cost regressions. This skill is **preventive** — for live cost analysis of a running deployment, compose with Microsoft's [`azure-cost`](https://github.com/microsoft/azure-skills) skill.
## The canonical guardrails
Every project scaffolded by this plugin inherits these defaults. Verify them when auditing.
### 1. SWA Free tier in test, Standard only in prod when needed
```bicep
skuName: environment == 'prod' ? 'Standard' : 'Free'
```
Standard is $9/month per app. Skip it unless you need custom domains, SLA, or the larger function quota.
### 2. SQL Serverless with auto-pause
```bicep
sku: { name: 'GP_S_Gen5_1', tier: 'GeneralPurpose', family: 'Gen5', capacity: 1 }
properties: {
autoPauseDelay: 15 // minutes before pause
minCapacity: json('0.5')
maxSizeBytes: 1073741824 // 1 GB
}
```
Paused = storage cost only (~$0.10/GB/month). First request after pause takes 30–60s.
### 3. Container Apps scale-to-zero
```bicep
scale: {
minReplicas: 0 // <<< the cost win
maxReplicas: 3
}
workloadProfileName: 'Consumption' // never 'Dedicated D4/D8' — those bill per-minute idle
```
Idle = $0. Use `minReplicas: 1` only when cold-start hurts UX.
### 4. Log Analytics `dailyQuotaGb` cap
```bicep
workspaceCapping: { dailyQuotaGb: 1 }
```
Single most important setting. Without it, a logging bug can ingest 100+ GB overnight.
### 5. Stora