Connect TeamCity to TFS

I am trying to connect a TeamCity project to my TFS project. I tried a bunch of things, but always get the same error:

TFS failed. ExitCode: 111, command: C:\TeamCity\webapps\ROOT\WEB-INF\plugins\tfs\bin\tfs-native.exe @@C:\TeamCity\temp\TC-TFS-25-7939_109\command.params, in file: {https://budiedimas.visualstudio.com/DefaultCollection/TesteTeamCity, /hash:S, /noProxy, C:\TeamCity\temp\TC-TFS-25-7939_108.result, ConnectionTest, $/TesteTeamCity/TesteTeamCity}, completed in: 1 second(s) stdout: TFS Native Verifier v8.0 Copyright (C) 2006-2013 JetBrains sro 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 sro 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:\BuildAgent\work\23f504c63c17dfdf\TfsNativeAccessor\src\Command.cs:linha 28 em JetBrains.TeamCity.Tfs.Program.Main(String[] args) na c:\BuildAgent\work\23f504c63c17dfdf\TfsNativeAccessor\src\Program.cs:linha 134 --- Fim do rastreamento de pilha de exceโ€กรคes internas --- em JetBrains.TeamCity.Tfs.Program.Main(String[] args) na c:\BuildAgent\work\23f504c63c17dfdf\TfsNativeAccessor\src\Program.cs:linha 438 

I always get the error:

'You do not have permissions / DefaultCollection /'

I have administrator rights in everything that is in TFS, and I donโ€™t know if any authorization configuration in TeamCity is missing.

Does anyone know why this is happening?

+6
source share
3 answers

I finally managed to get this working in the latest version of teamcity (for me it is 8.0.3), but it seems to work with version 7.1.4 ,

  • First configure the alternate credentials in TFS (profile โ†’ credentials โ†’ enable alternate credentials)

  • Then in TeamCity

    • Use the following URL format: https: // {yournamehere} .visualstudio.com / DefaultCollection
    • For the username, use the alternate credential name that you set in step 1. BUT, put it in the following format: ## LIVE ## \ usernamehere "(in fact, this is indicated below, but somehow I missed it the first time! )

Hope this helps someone else since I spent a lot of time on this!

+12
source

I blurred my name and username, but I know that photos help a lot of people. This is @Rob Birds solution to solve this problem. I can't thank him enough! Again, make sure that you have at least VisualStudio 2012 Update 1 with Team Explorer installed on the build assembly server and TeamCity agent. After updating Visual Studio (if necessary), you will also need to restart the TeamCity build server and build agent.

enter image description here

+2
source

Sounds like a cache problem. Reloading the city team service worked for me

0
source

Source: https://habr.com/ru/post/952515/


All Articles