将 TeamCity 连接到 TFS [英] Connecting TeamCity to TFS

查看:28
本文介绍了将 TeamCity 连接到 TFS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力尝试将我的 TeamCity 项目连接到我的 TFS 项目.我尝试了很多东西,但总是得到同样的错误:

I'm struggling trying to connect my TeamCity project to my TFS project. I tried a bunch of stuff, but I always get the same error:

TFS failed. ExitCode: 111, command: C:TeamCitywebappsROOTWEB-INFplugins	fsin	fs-native.exe @@C:TeamCity	empTC-TFS-25-7939_109command.params, in file: {https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity, /hash:S, /noProxy, C:TeamCity	empTC-TFS-25-7939_108.result, ConnectionTest, $/TesteTeamCity/TesteTeamCity}, completed in: 1 second(s)
stdout: TFS Native Verifier v8.0 Copyright (C) 2006-2013 JetBrains s.r.o.
Running under .NET Framework 4.0.30319.18052
INFO  - 
INFO  - Use Team Explorer 2012
INFO  - 
TFS Native Accessor v8.0 Copyright (C) 2006-2013 JetBrains s.r.o.
INFO  - Connecting to server https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity
INFO  - WebProxy is disabled
Connection test:
  Server='https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity'
  Root='$/TesteTeamCity/TesteTeamCity'
ERROR - TF30063: You are not authorized to access https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity.
System.Exception: TF30063: You are not authorized to access https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity. ---> Microsoft.TeamFoundation.TeamFoundationServerUnauthorizedException: TF30063: You are not authorized to access https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity.
   em Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.EnsureTokenProvider(HttpWebResponse webResponse)
   em Microsoft.TeamFoundation.Client.Channels.TfsHttpWebRequest.SendRequest()
   em Microsoft.TeamFoundation.Client.Channels.TfsHttpRequestChannel.Request(TfsMessage message, TimeSpan timeout)
   em Microsoft.TeamFoundation.Client.Channels.TfsHttpClientBase.Invoke(TfsClientOperation operation, Object[] parameters, TimeSpan timeout, Object[]& outputs)
   em Microsoft.TeamFoundation.Framework.Client.Registration.GetRegistrationEntries(String toolId)
   em Microsoft.TeamFoundation.Framework.Client.RegistrationProxy.GetRegistrationEntries(String toolId)
   em Microsoft.TeamFoundation.Framework.Client.RegistrationService.GetInstanceId()
   em Microsoft.TeamFoundation.Framework.Client.RegistrationService.get_InstanceClientCacheDirectory()
   em Microsoft.TeamFoundation.Framework.Client.RegistrationService..ctor(TfsTeamProjectCollection tfsObject)
   em Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.CreateServiceProxy(Type serviceType)
   em Microsoft.TeamFoundation.Client.TfsTeamProjectCollection.GetServiceInstance(Type serviceType, Object serviceInstance)
   em Microsoft.TeamFoundation.Client.TfsConnection.GetService(Type serviceType)
   em Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.FindServiceLocation(String serviceType, String toolId)
   em Microsoft.TeamFoundation.Framework.Client.PreFrameworkServerDataProvider.LocationForCurrentConnection(String serviceType, Guid serviceIdentifier)
   em Microsoft.TeamFoundation.Client.TfsConnection.EnsureProviderConnected()
   em JetBrains.TeamCity.Tfs.Command.Do() na c:BuildAgentwork23f504c63c17dfdfTfsNativeAccessorsrcCommand.cs:linha 28
   em JetBrains.TeamCity.Tfs.Program.Main(String[] args) na c:BuildAgentwork23f504c63c17dfdfTfsNativeAccessorsrcProgram.cs:linha 134
   --- Fim do rastreamento de pilha de exce‡äes internas ---
   em JetBrains.TeamCity.Tfs.Program.Main(String[] args) na c:BuildAgentwork23f504c63c17dfdfTfsNativeAccessorsrcProgram.cs:linha 438

我总是收到错误:

'您无权访问/DefaultCollection/'

'You are not authorized to access /DefaultCollection/'

我对 TFS 上的所有内容都拥有管理员权限,但我不知道我是否缺少 TeamCity 上的某些授权配置.

I have admin rights in everything on the TFS and I don't know if I'm missing some authorizantion configuration on the TeamCity.

有人知道为什么会这样吗?

Does anyone have any idea why this is happening?

推荐答案

我终于设法在最新版本的 teamcity(对我来说是 8.0.3)中使其正常工作,但显然自 7.1.4.

I finally managed to get this working in the latest version of teamcity (which for me is 8.0.3) but apparently this has been working since version 7.1.4.

  1. 首先在 TFS 中配置备用凭据(配置文件 -> 凭据 -> 启用备用凭据)

  1. First configure alternate credentials in TFS (profile -> credentials -> enable alternate credentials)

然后在 TeamCity

Then in TeamCity

  • 使用以下 URL 格式:https://{yournamehere}.visualstudio.com/DefaultCollection
  • 对于用户名,请使用您在第 1 步中设置的备用凭据名称.但是将其放入以下格式##LIVE##usernamehere"(它实际上会在框下方告诉您这一点,但我第一次错过了!)
  • Use the following URL format: https://{yournamehere}.visualstudio.com/DefaultCollection
  • For the username use the alternate credential name you setup in step 1. BUT put it in the following format "##LIVE##usernamehere" (It actually tells you this below the box, but I somehow missed it first time!)

希望这能帮助其他人,因为我浪费了很多时间!

Hope this helps someone else, as I wasted quite a bit of time on this!

这篇关于将 TeamCity 连接到 TFS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆