A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
Hello PIYUSH SOLANKI,
Thank you for reaching out to the Microsoft Q&A forum.
When investigated In Azure the “RDS‐equivalent” PaaS services are:
- Azure SQL Database – fully managed single or pooled databases
- Azure SQL Managed Instance – near 100% SQL Server compatibility in a PaaS model
Below is a two‐step approach showing you how to find
(1) idle databases/instances and (2) over-provisioned ones, and then how to right-size them using the Azure CLI.
Identify idle SQL Databases / Managed Instances
- Key metrics to watch: – cpu_percent (average CPU usage) – dtu_consumption_percent (for DTU‐based DBs) – vcore_consumption_percent (for vCore‐based DBs) – data_io_percent, log_write_percent (optional)
• CLI example to pull the last 7 days of avg CPU for a single database:
az monitor metrics list \
--resource /subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Sql/servers/<server>/databases/<db> \
--metric cpu_percent \
--interval P7D \
--aggregation Average \
--output table
•If you see Average CPU < 5 % (or DTU % < 10 % consistently) it’s a good candidate for decommissioning or pausing (serverless).
• For serverless tier you can also query the “paused” state:
az sql db show \
--resource-group <rg> \
--server <server> \
--name <db> \
--query "sku.tier, status"
Find over-provisioned instances
- • Compare actual usage vs provisioned capacity. Rule of thumb: if avg CPU < 30 % and peak CPU < 75 % over a 30-day window, plan to downsize.
• CLI example to pull peak CPU and DTU for all DBs in a server:
for db in $(az sql db list --resource-group <rg> --server <server> --query "[].name" -o tsv); do
echo "DB: $db"
az monitor metrics list \
--resource /subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Sql/servers/<server>/databases/$db \
--metric cpu_percent dtu_consumption_percent \
--interval P30D \
--aggregation Average,Maximum \
--output table
Right-size with CLI
• Change service objective (DTU model) or vCore count (vCore model) – DTU example:
az sql db update \
--resource-group <rg> \
--server <server> \
--name <db> \
--service-objective S0
– vCore example:
bash az sql db update \ --resource-group <rg> \ --server <server> \ --name <db> \ --edition GeneralPurpose \ --family Gen5 \ --capacity 2
• For Managed Instance:
az sql mi update \
--name <mi-name> \
--resource-group <rg> \
--vcores 8 \
--storage <new-size-in-gb>
(Optional) Automate idle shutdown of Managed Instances • Use start/stop schedules to eliminate vCore charges during known idle windows:
https://docs.microsoft.com/azure/azure-sql/managed-instance/instance-stop-start-how-to
Reference list
- Plan and manage costs for Azure SQL Database https://docs.microsoft.com/azure/azure-sql/database/cost-management
- Azure SQL Database architecture best practices (cost optimization) https://docs.microsoft.com/azure/well-architected/service-guides/azure-sql-database#cost-optimization
- Architecture best practices for Azure SQL Managed Instance https://docs.microsoft.com/azure/well-architected/service-guides/azure-sql-managed-instance#cost-optimization
- FinOps best practices for Databases (ARG queries) https://docs.microsoft.com/cloud-computing/finops/best-practices/databases#sql-databases
- Azure CLI – az monitor metrics list https://docs.microsoft.com/cli/azure/monitor/metrics#az_monitor_metrics_list
- Choose between the vCore and DTU purchasing models https://docs.microsoft.com/azure/azure-sql/database/purchasing-models
- Optimize Reserved Instance usage for existing resources https://docs.microsoft.com/azure/cost-management-billing/reservations/reserved-instance-purchase-recommendations
Let me know if any further queries - feel free to reach out!