Question

I am trying to create a program in c# that allows me to connect to my TFS in order to create new work items.

NetworkCredential netCred = new NetworkCredential(
"username",
"password");
BasicAuthCredential basicCred = new BasicAuthCredential(netCred);
TfsClientCredentials tfsCred = new TfsClientCredentials(basicCred);
tfsCred.AllowInteractive = false;

TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(
new Uri("https://example.visualstudio.com/DefaultCollection"),tfsCred);

tpc.Authenticate();

At the moment when I am trying to make a connection to TFS I am using my own Live username and password which is giving me the error message "TF30063: You are not authorized". I'm not sure on the different ways to make a connection to TFS.

I believe the correct way is using the service credentials, but at the moment I can't workout how to find out the service credentials only I am not sure how to find out my service credentials within TFS.

Was it helpful?

Solution

You need to enable alternate credentials when connecting to Visual Studio Online with the TFS API.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top