Home / Databases / SQL Server

DatabasesHow-toIntermediate

Azure SQL cost transformation: right-sizing, serverless, elastic pools, reservations and AHB

A FinOps playbook for SQL estates already in Azure. Covers finding idle and oversized databases, moving spiky databases to serverless, consolidating into elastic pools or instance pools, reservations, Azure Hybrid Benefit hygiene, and dev/test savings.

Deepak Bhardwaj3 min read

Applies toAzure SQL Database, Azure SQL Managed Instance, SQL Server on Azure VMs

1. Find the waste

// Azure SQL DB CPU utilisation (diagnostic metrics in Log Analytics)
AzureMetrics
| where ResourceProvider == "MICROSOFT.SQL" and MetricName == "cpu_percent" and TimeGenerated > ago(30d)
| summarize p95 = percentile(Average, 95), avg = avg(Average) by Resource
| order by p95 asc
Finding Action
p95 CPU < 20% for 30 days Scale down a size
No connections for 30 days Confirm with owner → delete (export first)
Many small DBs, each underused Elastic pool
Busy only in office hours / spiky Serverless with auto-pause
Dev/test on production tiers Dev/test subscription pricing, smaller tiers, auto-pause

Azure Advisor also lists right-sizing and idle-resource recommendations.

2. Serverless (Azure SQL Database)

az sql db update -g rg-sql -s sqlsrv-dev -n Reporting --edition GeneralPurpose \
  --compute-model Serverless --family Gen5 --min-capacity 0.5 --capacity 4 --auto-pause-delay 60
  • Billed per second of vCore use; storage still billed while paused.
  • First connection after a pause waits for resume (up to about a minute) — fine for dev and internal tools, not for latency-sensitive production.

3. Elastic pools

Databases with different peak times share vCores:

az sql elastic-pool create -g rg-sql -s sqlsrv-prod -n pool-saas --edition GeneralPurpose \
  --family Gen5 --capacity 8 --db-max-capacity 4 --db-min-capacity 0
az sql db update -g rg-sql -s sqlsrv-prod -n Tenant042 --elastic-pool pool-saas

Rule of thumb: pools pay off when the sum of individual peaks is much larger than the pool's combined peak (typical for SaaS tenants).

For MI, instance pools host several small instances on shared vCores.

4. Commitments

  • Reserved capacity (1 or 3 years) for steady vCores on SQL DB, MI and elastic pools.
  • Azure Hybrid Benefit: make sure every eligible resource has it on (licenseType = BasePrice); use centrally managed AHB to assign licences at scope level.
  • SQL VMs: AHB plus VM reservations or savings plans.
resources
| where type in ("microsoft.sql/servers/databases","microsoft.sql/managedinstances")
| extend lic = tostring(properties.licenseType)
| summarize count() by type, lic

5. Storage and backup costs

  • Backup storage redundancy: LRS/ZRS for non-critical databases instead of GRS where policy allows.
  • PITR retention 7 days for dev/test; LTR only where required.
  • Archive cold data out of expensive tiers.

6. Make it stick

  • Tags: app, env, owner, costCenter on every SQL resource; monthly cost reports per app.
  • Budgets and anomaly alerts per subscription.
  • A quarterly right-sizing review with app owners.

Tip

The fastest wins are usually dev/test: auto-pause serverless, smaller tiers, and deleting forgotten copies often cut 20–30% of the SQL bill in the first month.