0

Is there a way how can I get alert (notification/email) when our Azure Database is down? Maybe something with datacenter, or DB is in the Deprecated status.

So far, I found one query, that we might use

SELECT 'myDatabase status is:' AS Description, 
       ISNULL((SELECT state_desc 
               FROM sys.databases WITH (NOLOCK) 
               WHERE name ='DB Name'),'Not Found') AS [DBStatus]

Maybe I should create some background job. But I was thinking, if there is something built in that we can use.

2 Answers 2

1

You can receive an alert based on monitoring metrics for, or events on, your Azure services. You can opt :

  • Receive Service Notifications
  • Track Service Health

enter image description here

For an alert rule on a metric value, when the value of a specified metric crosses a threshold assigned, the alert rule becomes active and can send a notification. For an alert rule on events, a rule can send a notification on every event, or, only when a certain number of events happen.

When you create an alert rule, you can select options to send an email notification to the service administrator and co-administrators or to another administrator that you can specify. A notification email is sent when the rule becomes active, and when an alert condition is resolved.

References :

How to: Receive Alert Notifications and Manage Alert Rules in Azure

How can Azure notify me when my primary database becomes unavailable?

Sign up to request clarification or add additional context in comments.

1 Comment

yes, i was checking that, but couldn't figure it out, what option should i use to find out, if DB is not accessible. Maybe Failed Connections? Couldn't find more details. Thanks
0

As the previous user posted, metric based alerts are probably the closest built-in solution but it doesn't fully address your scenario. If the database is down, the associated metrics are likely not guaranteed to be functional.

Your best bet is to setup a cron job to issue some synthetic SQL query via either Azure Scheduler or Azure Logic Apps.

Longer term, the platform would provide this built-in alerting capability via Resource Health.

https://learn.microsoft.com/en-us/azure/resource-health/resource-health-overview

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.