Is VSTS supported? I'm trying to set up a VSTS repository using the TFS settings with VS 2017 installed and the connection already established. I have also authenticated through running "tf.exe workspaces". When I click validate in Continua CI with any form of credentials or none at all I get "Failed to authenticate with server, please check username and password".
I selected TFS 2015 as the TFS Version and then the repository was validated successfully. I did not supply credentials or check 'Use basic authentication'
Hi Steve,
To use basic authentication, you need to "enable alternate authentication credentials" in the VSTS Security area which you can get to via the menu under your account icon.
If you don't use tick 'Use basic authentication', Continua CI will attempt to authenticate with Windows authentication using the user account that the Continua CI Server service is logged in as. I suspect that you service is running under an account which has access to VSTS on your domain which is why you were able to log in without credentials.
Excellent, that worked! Thank you! I was also able to select TFS 2017 to match my VS.
Another authentication issue I’m now having is being able to run Team Foundation actions pointed to a VSTS server in my FB project launched by Continua. I keep seeing this error even though the various Team Foundation actions succeed when manually run in the FB UI or locally through FBCMD. I set the default credentials as my own. I also tried to run tf.exe to cache my credentials due to tf.exe not supporting alternative logins. Do we need specific VSTS actions to map folders and get sources?
Team Foundation Map Working Folder [ C:\Source\MyProject $/MyProject ]
Path to Executable: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\tf.exe
Command line: workfold /login:“MyUser@MyCompany.com”,PASSWORD /map /s:https://MySite.visualstudio.com /workspace:MyComputer $/MyProject C:\Source\MyProject
Error: TF30063: You are not authorized to access https://MySite.visualstudio.com/.
Failed!
I tried to script this out in Continua by running a DOS command and variable for the password and got the same not authorized message with exit code 100.
Hi Steve,
The main difference between running tf.exe locally on the command line and running it under Continua CI is the user account that it runs under.
It's difficult to find definitive information on the tf.exe command line, but it appears to only support logging into Visual Studio Online via OAuth2. Basic authentication can only be used to login into on-premise team services. OAuth2 authentication is problematic as it pops up a dialog requesting credentials, which is not acceptable when running under a service such as Continua CI.
I suspect the reason the command is working locally is that you have already logged into Visual Studio Online and the credentials are stored in your user profile. If so then you should be able to run the same command line locally without the /login parameter?
You can workaround the issue running the command line under Continua CI by storing the credentials under the user account that the agent service is running under. Log in to the computer which the agent is running on using this user account and run the tf.exe command line without supplying credentials. When the prompt appears enter the username and password and the credentials should then be stored for that account. This should allow you to run the tfs.exe command under Continua CI without providing credentials.
We'll continue to investigate other options for authenticating the FinalBuilder TFS commands against Visual Studio Online.
In common Continua CI usage, you shouldn't really need to run TFS commands to map a workspace folder, as this is all done automatically. Continua CI checks out the repository files and copies them to the agent workspace according to the repository rules. With the default repository rules, these files can then be accessed using the expression $Workspace$\Source\RepoName or $Source.RepoName$.
I got it working by adding my credentials under the agent service which is running on the same machine as the server service for now. I didn’t realize the extensive customization under the build stage options for the workspace/repo rules. This definitely helps as I enhance the configuration and expand the project to include more agents. Thanks for the detailed response. Support on these forums is great.