Why is my TFS project build failing and I cannot select my predefined credentials for checkout?

Article ID:360030082792
1 minute readKnowledge base

Issue

You are unable to build tfs projects using Jenkins Git plugin, due to what you think is a credential management problem.

The symptoms observed are that once that your pipeline tries to checkout the code the credentials are not properly passed so the script returns an error and the build fails. You also see that your Local scope defined credentials do not show in the credentials dropdown selector.

Resolution

First of all, you can ignore the error on the repository access using the provided credentials if your controller does not have MsBuild installed, as the validation happens inside your controller.

The cause for your defined credentials not being available for selection is coming from the fact that the Git plugin is not able to get access to credentials defined out of Global scope. Once that you define your credentials at Global level, you will be able to use them to build the project successfully.

Workaround

The recommended approach for TFS projects is that you use the Team Foundation Server Plugin, and use personal tokens generated from your TFS server whenever possible.