0
votes

I am trying to check in files into Microsoft Visual Studio TFS from jenkins using the tf.exe check in command. The command works fine when executed from a command prompt in windows but when i incorporate the commands in a .bat file and invoke through ANT scripts in Jenkins i am getting the below error. Could you please let us know what probably might be the issue?

On another note the same credentials are being used in the jenkins job to get files from TFS successfully.

Error:

TF30063: You are not authorized to access http://<>:8080/tfs/<>

Bat file:

cd %1 tf workspaces /collection:http://<>:8080/tfs/<> login:<>,<> tf add %2 tf checkin /noprompt

1
Are you using the Execute Windows batch command and Invoke ANT in Build section of a Jenkins item?PatrickLu-MSFT
No...i am invoking the .bat file from Ant script and im calling the Ant script from Jenkins. Hope that clarifies.D P

1 Answers

0
votes

First make sure you have created the authentication link between the TFS instance and the system profile. Jenkins, running in that user profile context, should then be able to issue TF commands and create workspaces, check in codes.

You could follow below tutorial to generate Credentials, create build item. How to setup automated builds using Jenkins and Visual Studio Team Foundation Server Suggest you to create Global configuration, after configuring your team project collection, this will use automatic credentials configuration with the TFVC SCM. If you configure Jenkins use the alternate credentials, then every command that you pass must include the same creds.