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
Enjoy!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.