1

所以我设置了 TFS 持续部署,我遇到了这样一种情况,即我的构建编译得很好,但在与 Azure 通信时在部署阶段失败。我的日志看起来像

Get Default Azure Cloud Service Publish Profile
Set Project to build CSPack
Run MSBuild for Project
Run Visual Studio Test Runner for Test Sources
Publish Output
Deploy application to Azure
8/23/2012 7:20:04 AM - Preparing deployment for rcfoapi with SubscriptionID: mysubscriptionidhere.veryverylong.andkeepsgoing...
8/23/2012 7:20:04 AM - Connecting...
 An attempted http request against URI https://management.core.windows.net:8443/mysubscriptionidhere.veryverylong.andkeepsgoing
 /services/hostedservices/myrolenamehere?embed-detail=true 
 returned an error: (403) Forbidden.
Additional Exception Information:
Error Code: AuthenticationFailed
Message: The server failed to authenticate the request. Verify that the 
         certificate is valid and is associated with this subscription.
         Typically, a response of (403) Forbidden from a Windows Azure 
         Management API means that the X509 certificate used to 
         authenticate the call is not valid. The certificate may have 
         been revoked or expired. Reconnect your Windows Azure 
         subscription to your Team Foundation account.

我尝试了 Azure 门户中的“与 TFS 断开连接”链接,然后验证了 Azure 门户的“证书”部分中的证书。我使用指纹哈希确认相同的证书也在我的本地计算机的证书存储(“我的”存储)中。然后我通过 Azure 门户重新链接 TFS。

但我仍然得到同样的错误。任何想法?

更新 我还尝试了一些额外的步骤,似乎没有任何工作:(

  1. 删除了整个云服务
  2. 创建了一个新的云服务(同名)
  3. VS2012 在生产和登台上部署到云服务(因为我需要为前端使用和后端测试提供服务)
  4. 验证门户的云服务“证书”部分中的 Windows Azure 工具证书(与我的本地副本匹配)。我知道这与 TFS 和 Azure 之间的不同
  5. 去了 TFSPreview.com => 左上齿轮 => 项目管理 => 服务 => 没有看到链接的服务
  6. 转到用户配置文件 => 连接 => 列出 OAuth 连接(Windows Azure 的 MANAGE-PROD CLOUDAPP)=> 删除它
  7. 在 Azure 门户中,将新设置的云服务链接回 TFSPreview.com
  8. 在 VS2012 本地,断开 TFS ('team' => 'disconnect')
  9. 在VS2012本地,退出TFS('team' => 'connect' => 'sign out' at the bottom)
  10. 重新登录 TFS,连接到团队项目
  11. 做了一个微不足道的更改 => 签入 => 触发持续部署

=> 和以前一样的错误:?

谢谢

4

3 回答 3

0

如果您的证书需要在 Azure 控制面板中续订,则可能会发生这种情况。

如果您没有首先部署暂存或生产环境,也可能发生这种情况。我不完全确定为什么,因为它部署了一个新的,但这刚刚解决了我的问题。

于 2013-12-31T00:26:17.377 回答
0

TFS 预览版使用的证书与您在本地开发盒上的证书不同。当您连接帐户时,Azure 会为 TFS 提供不同的证书,该证书可能已过期或不再存在。如果您有多个项目连接到 Azure,唯一的选择是进入 TFSPreview 上的管理站点(右上角的齿轮)并断开连接到该订阅的所有项目,然后重新运行连接向导。这将确保我们为您的 Azure 订阅获得新的有效证书。当您将订阅重新连接到项目时,我们将找到现有的构建定义,而不是创建新的。

于 2012-08-23T13:36:52.570 回答
0

我有同样的问题,对我来说解决方案是更新证书。见这里:http: //support.microsoft.com/kb/2780289

于 2013-11-22T11:02:13.300 回答