Jump to content

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


Recommended Posts

Guest Jose_Manuel_Jurado
Posted

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!

 

Continue reading...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...