Share via

Cost Savings idea and metrics to find idle SQL instances and overprovisioned Instances separately.

PIYUSH SOLANKI 60 Reputation points
2026-05-04T05:59:29.3833333+00:00

Hello Community ,

I was working on Azure SQL Database , Azure SQL Managed SQL Database , so I wanted to find out different ways of optimizing cost in using them. How can I find out the idle instances and using which metrics so that I can show that practically , and how can i find out over provisioned instances and then suggest to right size them , both things practically using CLI . Also what is the exact equivalent service in Azure of AWS RDS . Also provide me the links of the document where metrics and these things are mentioned.

Cost Management
Cost Management

A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.


Answer accepted by question author

  1. Siva shunmugam Nadessin 9,625 Reputation points Microsoft External Staff Moderator
    2026-05-04T07:09:16.0566667+00:00

    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

    1. • 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

    1. Plan and manage costs for Azure SQL Database https://docs.microsoft.com/azure/azure-sql/database/cost-management
    2. Azure SQL Database architecture best practices (cost optimization) https://docs.microsoft.com/azure/well-architected/service-guides/azure-sql-database#cost-optimization
    3. Architecture best practices for Azure SQL Managed Instance https://docs.microsoft.com/azure/well-architected/service-guides/azure-sql-managed-instance#cost-optimization
    4. FinOps best practices for Databases (ARG queries) https://docs.microsoft.com/cloud-computing/finops/best-practices/databases#sql-databases
    5. Azure CLI – az monitor metrics list https://docs.microsoft.com/cli/azure/monitor/metrics#az_monitor_metrics_list
    6. Choose between the vCore and DTU purchasing models https://docs.microsoft.com/azure/azure-sql/database/purchasing-models
    7. 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!

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Sedat SALMAN 14,450 Reputation points MVP
    2026-05-04T06:10:25.1833333+00:00

    Azure equivalent of AWS RDS is Azure SQL Database.
    For near full SQL Server instance go for Azure SQL Managed Instance.

    How to find idle DB

    Check 14–30 days metrics:

    • CPU %
    • DTU / vCore usage
    • Data IO %
    • Log IO %
    • Sessions / connections

    If all near zero it is idle candidate. Azure Monitor provides these metrics

    https://learn.microsoft.com/en-us/azure/azure-sql/database/monitoring-metrics-alerts?view=azuresql

    https://learn.microsoft.com/en-us/azure/azure-sql/database/monitoring-sql-database-azure-monitor?view=azuresql

    If usage is consistently low even at peak then downsize tier / move to pool / serverless.
    Azure recommends monitoring CPU and IO vs selected service tier for tuning.

    https://docs.azure.cn/en-us/azure-sql/database/monitor-tune-overview?view=azuresql

    example cli

    az monitor metrics list \
      --resource "<db-resource-id>" \
      --metric cpu_percent,dtu_consumption_percent,physical_data_read_percent,log_write_percent,sessions_percent \
      --interval PT1H \
      --aggregation Average Maximum
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.