Lesson Learned #299: Blocking user connections in Azure SQL Managed Instance
Published Jan 22 2023 02:05 AM 1,557 Views

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 | Mic... 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 



Version history
Last update:
‎Jan 22 2023 02:05 AM
Updated by: