使用AAD集成方法时,sql托管实例身份验证失败



我使用Azure Active Directory with Federation(AD FS)方法设置了混合身份。我已经创建了sql托管实例,并添加了一个用户作为Active directory管理员。现在,我尝试使用AAD集成方法从作为用户登录的加入域的VM连接到这个sql管理的实例。连接失败,出现以下错误:

====================================

无法连接到{},3342。

====================================

出现一个或多个错误。(mscorlib)


程序位置:

位于System.Threading.Tasks.Task.SthrowIfExceptional(布尔值包括TaskCanceledExceptions)在System.Threading.Tasks.Task.Wait(Int32毫秒超时,CancellationToken取消令牌)位于System.Data.SqlClient.SqlInternalConnectionTds.GetFedAuthToken(SqlFedAuthInfo fedAuthInfo)位于System.Data.SqlClient.SqlInternalConnectionTds.OnFedAuthInfo(SqlFedAuthInfo-fedAuthInfo)位于System.Data.SqlClient.TdsParser.TryRun(RunBehavior RunBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj,Boolean和dataReady)位于System.Data.SqlClient.TdsParser.Run(RunBehavior RunBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject stateObj)位于System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(布尔登记OK)在System.Data.SqlClient.SqlInternalConnectionTds.AttremptOneLogin(ServerInfo ServerInfo,String newPassword,SecureString newSecurePassword,布尔忽略SniOpenTimeout,超时计时器超时,布尔带故障转移,布尔为FirstTransparentAttrempt,布尔禁用Tnir)位于System.Data.SqlClient.SqlInternalConnectionTds.LoginoFailover(ServerInfo ServerInfo、String newPassword、SecureString newSecurePassword、布尔重定向的UserInstance、SqlConnectionString connectionOptions、SqlCredential凭据、TimeoutTimer超时)位于System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginList(超时计时器超时、SqlConnectionString连接选项、SqlCredential凭据、字符串newPassword、SecureString newSecurePassword、布尔重定向用户实例)位于System.Data.SqlClient.SqlInternalConnectionTds.ctor(DbConnectionPoolIdentity标识、SqlConnectionString连接选项、SqlCredential凭据、对象提供者信息、字符串newPassword、SecureString newSecurePassword、布尔重定向用户实例、SqlConnectionStringuserConnectionOptions、SessionData reconnectionSessionData、DbConnectionPool池、字符串访问令牌、布尔应用程序TransientFaultHandling、SqlAuthenticationProviderManager sqlAuthProviderManager)位于System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项、DbConnectionPoolKey poolKey、Object poolGroupProviderInfo、DbConnectionPool池、DbConnection owningConnection、DbConnectionOptions userOptions)位于System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection,DbConnectionPoolGroup poolGroup,DbConnectionOptions userOptions)位于System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource重试,DbConnectionOptions userOptions)在System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection,DbConnectionFactory connectionFactory,TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1重试)位于System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1重试)位于System.Data.SqlClient.SqlConnection.Open()位于Microsoft.SqlServer.Management.SqlStudio.Explorer.ObjectExplorerService.ValideConnection(UIConnectionInfo-ci,IServerType服务器)位于Microsoft.SqlServer.Management.UI.ConnectionDlg.ConnectionThreadUser()

====================================

出现一个或多个错误。(mscorlib)


程序位置:

位于System.Threading.Tasks.Task.SthrowIfExceptional(布尔值包括TaskCanceledExceptions)位于System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task1.get_Result()位于System.Data.SqlClient.SqlInternalConnectionTds。<gt;c__DisplayClass134_1.b_0()位于System.Threading.Tasks.Task`1.InnerInvoke()在System.Threading.Tasks.Task.Execute()

====================================

无法分析XML blob。原因:XML文档必须具有顶级元素。行:0,位置:0文本:(空)(系统数据)


程序位置:

在ADALNativeWrapper.ADALGetAccessToken(字符串用户名、IntPtr密码、字符串stsURL、字符串servicePrincipalName、ValueType correlationId、字符串客户端Id、布尔值*fWindowsIntegrated、Int64&fileTime)位于System.Data.SqlClient.ActiveDirectoryNativeAuthenticationProvider<gt;c__DisplayClass2_0.b_0()位于System.Threading.Tasks.Task`1.InnerInvoke()在System.Threading.Tasks.Task.Execute()

SSMS版本(最新):15.0.18384.0请帮我解决这个问题。

根据您收到的错误,请检查联合本地域是否为SSO配置了直通身份验证和密码哈希身份验证。此外,请检查尝试连接到数据库的虚拟机上是否安装了最新版本的SQL Server Management Studio或SQL Server Data Tools。

接下来,确认要连接到数据库的应用程序是否设置了服务主体API权限。'需要为应用程序添加Directory.Read.All"应用程序API权限,并将分配的Azure AD Admin设置为同意。应为Azure AD Admin凭据设置"SQL托管实例参与者"角色的服务主体。

对于Azure Active Directory–集成身份验证方法,在连接到数据库之前,请确保在SSMS数据库连接对话框的"选项"部分(右下角)中输入数据库名称。此外,请检查连接字符串中的参数,如"Active Directory集成"one_answers"集成安全性=True",以确保连接成功。

请参考以下链接以供参考:-

https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-configure?tabs=azure-powershell

https://azure.microsoft.com/en-gb/blog/windows-azure-now-supports-federation-with-windows-server-active-directory/

https://learn.microsoft.com/en-us/azure/azure-sql/database/authentication-aad-overview

谢谢你,

相关内容

最新更新