Blog Post

Azure Database Support Blog
1 MIN READ

Lesson Learned #299: Blocking user connections in Azure SQL Managed Instance

Jose_Manuel_Jurado's avatar
Jan 22, 2023

In some specific situations, our customer needs to block a connection from a single user. For example, users that they have to connect to the secondary replica using ApplicationIntent=Readonly but they are not doing this change in the connection string and connect to the primary replica by mistake or customers that they need to know who is connecting and/or block the connection if needed for specific situation. 

 

To know who is connecting: Besides that we could use XEvents overview - SQL Server, Azure SQL Database, and Azure SQL Managed Instance - SQL Server | Microsoft Learn we could use Audit SQL Managed Instance auditing - Azure SQL Managed Instance | Microsoft Learn

 

If we need to prevent the connection and there is not possible to disable the user, we could use Logon Triggers - SQL Server | Microsoft Learn 

 

Enjoy!

Published Jan 22, 2023
Version 1.0
No CommentsBe the first to comment