How do I get email alerts with Azure SQL Instance as a Service similar to alerts from SQL Server.

Sawyer, Robert E 1 Reputation point

SQL Server normally has alerts, this feature is not available on Azure SQL Instance as a service. What do I have to do or purchase to get this functionality?

Azure SQL Database
{count} votes

3 answers

Sort by: Most helpful
  1. Sawyer, Robert E 1 Reputation point

    Ok, here is the stupid answer,

    Create a job that queries the event logs and send an email if it sees a login failure. Keep a table with the last time it ran and filter the results by time.

    However, I don't seem to be able to query the event logs either.

    0 comments No comments

  2. Alberto Morillo 28,036 Reputation points MVP

    You can send alerts using dbmail on Managed Instance as explained on this documentation. You can use sp_readmierrorlog to read Managed Instance error log as explained on this documentation.

  3. Bas Pruijn 846 Reputation points

    If you are looking for a way to check login failures, you should look at setting up security auditing on the database or server. You can send the audit logs to storage, Event Hub or Log Analytics. Querying results in Log Analytics is not hard to do. All is described here:

    An other approach would be to make use of Azure SQL triggered functions. A function is triggered every time something changes in a table in the database (insert/update/delete). See This functionality is still in preview though.

    0 comments No comments