skip to Main Content

Basically title, I have a bunch of Azure SQL Serverless instances which are all configured to be auto-paused after 1 hour of inactivity. Is it possible to check if/when the pauses happen retroactively? For example in last week, last 30 days and so on. I know I can easily check CURRENT status of each database, but I cannot find a way to do so for past periods. HELP!

I’ve googled the crap out of this question and can’t seem to find an answer.

2

Answers


  1. If I understood your questions, do the follow:

    Go to the Azure portal (https://portal.azure.com), navigate to your Azure SQL Serverless instance, and then find the Monitoring section. From there, you can explore metrics and set up metric alerts.

    Or, you can also use Azure CLI or Azure PowerShell to programmatically retrieve metrics and logs data.

    AzureDiagnostics
    | where ResourceId == "<your_serverless_instance_resource_id>"
    | where Category == "SqlServer"
    | where OperationName == "AUTO PAUSE"
    | where TimeGenerated >= datetime("2024-01-01T00:00:00Z") and TimeGenerated <= datetime("2024-01-07T23:59:59Z")
    | project TimeGenerated, ResourceId, OperationName
    

    Replace <your_sql_serverless_instance_resource_id> with the resource ID of your Azure SQL Serverless instance. Adjust the time range (datetime("2024-01-01T00:00:00Z") and datetime("2024-01-07T23:59:59Z")) according to the period you want to query.

    Login or Signup to reply.
  2. If it was me, I would go to azure portal, select the database and go to the metrics chart. It also gives us the option to choose the timeframe you want and the granularity.

    Metrics screenshot

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search