Azure SQL DBA Tools: Connection Failure Logs
AzureFebruary 5, 2025

Azure SQL DBA Tools: Connection Failure Logs

A simple query you can run within the master database on any Azure SQL Server to view all server connections that failed — with enough detail for a DBA to generally find the root cause.

Viewing Connection Failures on Azure SQL

Here is a simple query you can run within the master database on any Azure SQL Server to view all server connections that failed. The details about the connection failure are not too specific, but a DBA can use it to generally find the root cause.

SELECT
    database_name
    , start_time
    , end_time
    , event_category
    , event_type
    , event_subtype
    , event_subtype_desc
    , severity
    , event_count
    , description
FROM master.sys.event_log
WHERE event_type = 'connection_failed'
ORDER BY start_time DESC

Key Columns

  • database_name — The Azure SQL database that the failed connection was attempting to reach.
  • start_time / end_time — The time window during which the failure event occurred.
  • event_type — Will be connection_failed for all rows returned by this query.
  • event_subtype_desc — A short description of the specific failure type (e.g., login failed, timeout, firewall block).
  • severity — Numeric severity rating of the event.
  • description — A human-readable description of what happened.

Common Connection Failure Causes

  • Login failed — Incorrect credentials, expired password, or a login that does not exist in the database.
  • Firewall rule missing — The client IP is not whitelisted in the Azure SQL firewall settings.
  • Database unavailable — The database is paused, scaling, or in a failover state.
  • Connection limit reached — The DTU or vCore limit for the service tier has been exceeded.
  • SSL/TLS mismatch — The client driver does not support the minimum TLS version required by the server.

Notes

The sys.event_log view is specific to Azure SQL Database and is not available on SQL Server on-premises. It retains events for approximately 30 days. For longer retention, consider routing logs to Azure Monitor or a Log Analytics workspace.


Datazip provides expert Azure SQL monitoring and managed DBA services. Call 1-833-DATAZIP or visit www.SQLBrainBox.com for our monitoring tool.

Need expert help protecting your SQL Server?

Datazip provides 24/7 managed backup monitoring, encryption, and Azure Recovery Vault setup. US-based engineers, fluent in T-SQL.