Assumptions: - Microsoft Entra Connect is already installed and syncing users - Azure AD (Entra ID) Admin is already configured on the SQL Managed Instance - User exists in On-Prem AD and is successfully synced to Entra ID - VM / machine is domain joined - Network connectivity to SQL MI is working (Port 1433 open internally)
Open SSMS and connect using:
Server Name: my-free-sql-mi.e5fb5eadee34.database.windows.net
Authentication: Azure Active Directory - Password or Azure Active Directory - Universal with MFA
CREATE LOGIN [yourdomain\username] FROM EXTERNAL PROVIDER;
GOUSE YourDatabaseName;
GO
CREATE USER [yourdomain\username] FROM LOGIN [yourdomain\username];
GO
ALTER ROLE db_owner ADD MEMBER [yourdomain\username];
GOwhoamiExpected format: yourdomain\username{=tex}
klistnslookup my-free-sql-mi.e5fb5eadee34.database.windows.netTest-NetConnection my-free-sql-mi.e5fb5eadee34.database.windows.net -Port 1433Expected: TcpTestSucceeded : True
Do NOT use: Integrated Security=SSPI;
Microsoft.Data.SqlClient
"Server=my-free-sql-mi.e5fb5eadee34.database.windows.net,1433;" +
"Database=YourDatabaseName;" +
"Authentication=Active Directory Integrated;" +
"Encrypt=True;" +
"TrustServerCertificate=False;" +
"Connection Timeout=30;"using Microsoft.Data.SqlClient;
var connectionString =
"Server=my-free-sql-mi.e5fb5eadee34.database.windows.net,1433;" +
"Database=YourDatabaseName;" +
"Authentication=Active Directory Integrated;" +
"Encrypt=True;" +
"TrustServerCertificate=False;";
using var connection = new SqlConnection(connectionString);
connection.Open();- Machine must be domain joined
- User must be synced to Entra ID
- Login must be created using FROM EXTERNAL PROVIDER
- DNS and port 1433 must be reachable
- Time synchronization must be correct
This configuration enables modern Kerberos-backed Windows authentication via Microsoft Entra ID.