我已经有了答案,但想把这个贴出来让别人找到。
当我从FS 和 PSA Demo Data下载 FS/PSA 演示数据并尝试针对 CRM v9 组织运行 PD 时,我遇到了这个问题。在我的一个租户的 5 个沙箱中,它无法连接到其中的 3 个。所有都是 v9 并且有 FS/PSA 定位。问题的第一个症状是 PD 会接受我的登录信息,让我选择一个组织,然后带我回到登录页面。在检查 %appdata%\Microsoft\Microsoft Dynamics® CRM Package Deployer\3.0.0.848\PackageDeployer_[token]-[date].log 的日志文件后,我看到了错误:“未授权的 Http 状态代码 (401) 应在响应”。
这是日志文件中的完整错误:
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Information 8 12/19/2017 10:54:48 AM ConnectAndInitCrmOrgService - Requesting connection to Organization with CRM Version: 9.0.0.3172
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 12/19/2017 10:54:48 AM ERROR REQUESTING Token FROM THE Authentication context
Microsoft.Xrm.Tooling.Connector.CrmServiceClient Error 2 12/19/2017 10:54:48 AM Source : Microsoft.IdentityModel.Clients.ActiveDirectory
Method : CreateFromUnauthorizedResponseCommon
Date : 12/19/2017
Time : 10:54:48 AM
Error : Unauthorized Http Status Code (401) was expected in the response
Parameter name: response
Stack Trace : at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationParameters.CreateFromUnauthorizedResponseCommon(IHttpWebResponse response)
at Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationParameters.CreateFromUnauthorizedResponse(HttpWebResponse response)
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.GetAuthorityFromTargetService(Uri targetServiceUrl) in c:\bt\362589\r\de3ae9\src\DynamicsCrmToolbox\Utilities\Microsoft.Uii.AddOn.DynamicsCRM.Connector\CRMWebSvc.cs:line 1815
at Microsoft.Xrm.Tooling.Connector.CrmWebSvc.ExecuteAuthenticateServiceProcess(Uri serviceUrl, ClientCredentials clientCredentials, X509Certificate2 userCert, UserIdentifier user, String clientId, Uri redirectUri, PromptBehavior promptBehavior, String tokenCachePath, Boolean isOnPrem, String authority, Uri& targetServiceUrl, AuthenticationContext& authContext, String& resource, CrmLogEntry logSink) in c:\bt\362589\r\de3ae9\src\DynamicsCrmToolbox\Utilities\Microsoft.Uii.AddOn.DynamicsCRM.Connector\CRMWebSvc.cs:line 1703