Get notification when an SQL database is in pause resume status

Nguyen, Tuan 20 Reputation points
2024-08-06T12:01:12.6666667+00:00

Hi,

I have an Azure SQL database and it get into pause/resume status as design with general purpose serverless tier.

Is there a way to setup notification (via azure portal, sending to an email) when this happen? I try to set up a service health alert based on this article https://learn.microsoft.com/en-us/azure/azure-sql/database/advance-notifications?view=azuresql but look like I do not receive anything.

Thank you very much,

Azure SQL Database
0 comments No comments
{count} votes

Accepted answer
  1. Konstantinos Passadis 19,251 Reputation points MVP
    2024-08-06T16:44:21.66+00:00

    Hello @Nguyen, Tuan

    You can do it per database, start from Database New Alert Rule :

    User's image

    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards


1 additional answer

Sort by: Most helpful
  1. Konstantinos Passadis 19,251 Reputation points MVP
    2024-08-06T12:11:33.6666667+00:00

    Hello @Nguyen, Tuan

    Welcome to Microsoft QnA!

    There are 2 options here :

    Azure Monitor

    Azure event grid

    Azure Monitor Simpler Cost Efficient

    How to Set It Up:

    1. Create Alert Rule: Go to Monitor in the Azure Portal.
    2. Select Alerts and click "+ New Alert Rule".
    3. Scope: Select your SQL Database resource.
    4. Condition:
      • Signal Name: "Basic metrics"
      • Metric: "Successful Connections"
      • Operator: "Less than or equal to"
      • Threshold: 0 (since connections drop to zero during pause)
    5. Action Group: Create or select an action group to define your notification preferences (e.g., email).
    6. Create: Create the alert rule.

    Event Grid - Enterprise solution

    • How to Set It Up:
      1. Create an Event Subscription: Go to your SQL Database resource in the Azure Portal.
      2. Select Events under the "Settings" section.
      3. Click "+ Event Subscription" and choose a name for your subscription.
      4. Event Types: Select "Pause" and "Resume" under the "Azure SQL Database" category.
      5. Endpoint Type: Choose the notification mechanism you prefer (e.g., Azure Function for custom logic, Logic App for workflow, Webhook for HTTP endpoint, Event Hubs for large-scale event ingestion).
      6. Configure the Endpoint: Provide the necessary details for your chosen endpoint. For an email notification, you can use a Logic App to send emails easily.
      7. Create: Create the event subscription

    https://learn.microsoft.com/en-us/azure/azure-monitor/alerts/alerts-overview

    https://learn.microsoft.com/en-us/azure/event-grid/overview

    --

    I hope this helps!

    Kindly mark the answer as Accepted and Upvote in case it helped!

    Regards


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.