如何在 Azure 分析服务器的 Active Directory 身份验证中修复 'Unable to Obtain Authentication Token'

How to fix 'Unable to Obtain Authentication Token' in Active Directory Authentication to Azure Analysis Server

我只是尝试按照步骤 here 进行操作,以便我可以从 C# 查询 Azure Analysis Services 模型。但是在 SQL Server Management Studio 中,当使用 "Active Directory - Password" 身份验证时,我无法连接到服务器,收到错误消息 "Unable to obtain authentication token using the credentials provided..."

我尝试使用 Analysis Services Admins 中显示的用户名,如下所示:john.doe_outlook.com#EXT#@johndoeoutlook.onmicrosoft.com 以及与 Azure 帐户关联的 outlook 电子邮件地址,格式为 john.doe@outlook.com.

我使用的密码也是我的微软账号密码。通过研究,我从来没有弄清楚我应该输入什么密码,我从哪里得到它?或者我到底需要做什么才能成功连接?

我尝试的两个用户名都会导致此消息:

无法使用提供的凭据获取身份验证令牌。如果您的 Active Directory 租户管理员配置了多重身份验证,或者如果您的帐户是 Microsoft 帐户,请从连接字符串中删除用户名和密码,然后重试。然后系统会提示您输入您的凭据。 (Microsoft.AnalysisServices.AdomdClient)

如果我输入 john.doe_outlook.com#EXT#@johndoeoutlook.onmicrosoft.com 作为用户名,我会收到这些消息:

user_realm_discovery_failed: 用户领域发现失败 (Microsoft.IdentityModel.Clients.ActiveDirectory)

远程服务器返回错误:(400) 错误请求。 (系统)

如果我输入 john.doe@outlook.com 作为用户名,我会收到这些消息:

序列不包含任何元素 (Microsoft.IdentityModel.Clients.ActiveDirectory)

我通过创建一个新的应用程序注册解决了这个问题,selected 'Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)' 代替 'Accounts in this organizational directory only (Default Directory)'。 当我在 SSMS 中连接到服务器时,我 select 支持 MFA 的 Active Directory 而不是 Active Directory-Password,然后我输入 john.doe@outlook.com。它连接。