Azure Resource Graph Explorer - Retrieving DTU Percentage

Suthii09 0 Reputation points
2024-12-02T14:51:25.14+00:00

I am trying to use Azure Resource Graph Explorer to obtain a list of databases along with their DTU percentage. However, my query returns NULL for the DTU_percentage column.

Is it possible to retrieve this information?

User's image

Thanks in advance

Azure SQL Database
SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,136 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sai Raghunadh M 1,295 Reputation points Microsoft Vendor
    2024-12-02T18:31:10.61+00:00

    Hi @Suthii09

    Thanks for the question and using MS Q&A platform

    The DTU percentage is a measure of performance for Azure SQL databases, and it's usually tracked using Azure Monitor or Azure Metrics. However, Azure Resource Graph Explorer is mainly used for checking information about resources (like their details and settings) and doesn't provide performance data like DTU usage

    To obtain DTU usage, please query Azure Monitor metrics instead of Azure Resource Graph. While Azure Resource Graph Explorer is excellent for querying resource properties, it is not suitable for performance metrics like DTU consumption.

    You can use Azure Monitor to get DTU consumption. Here’s a simple query example using Azure Metrics Explorer to get DTU usage:

    AzureMetrics

    | where Resource == "SQL Database" and ResourceName == "<Your Database Name>"
    | where ResourceType == "DATABASE"
    | where MetricName == "dtu_consumption"
    | summarize avg(Total) by bin(TimeGenerated, 1h), ResourceName
    

    If you need to list databases and their related properties, such as server name and database type, you can utilize Azure Resource Graph Explorer. For instance:

    Resources

    | where type == "microsoft.sql/servers/databases"
    | project name, resourceGroup, location, serverName, sku
    

    Hope this helps. Do let us know if you any further queries. If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


  2. Suthii09 0 Reputation points
    2024-12-03T11:07:03.53+00:00

    0 comments No comments

  3. Suthii09 0 Reputation points
    2024-12-03T11:11:35.65+00:00

    @Sai Raghunadh M

    I updated my query in 2 varities:

    But the results is showing this

    User's image

    But the DB having some high DTU's which i can see in the Azure Portal.

    Something is not working correctly

    AzureMetrics
    | where Resource == "xxxxxxxxx" // Database Name
    | where ResourceProvider == "Microsoft.Sql"
    | where MetricName == "dtu_consumption"
    | summarize avg(Total) by bin(TimeGenerated, 1h), Resource
    
    
    AzureMetrics
    | where Resource == "xxxxxxxxxxx" // Database name 
    | where MetricName == "dtu_consumption"
    | summarize avg(Total) by bin(TimeGenerated, 1h), Resource
    
    
    

Your answer

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