tf.exe authenticate for vsts

家住魔仙堡 提交于 2019-12-11 02:38:14

问题


I am trying to list all the workspaces and trying to authenticate tf.exe with vsts using the below commandline.

tf workspaces /Collection: https://[account].visualstudio.com/defaultcollection /login:USername,Password

The vsts account is backed by Azure Active Directory synced with an on-prem AD.

It works fine when I have connected to the vsts from visual studio and then running the above tf.exe command without the login switch.

But, when I use the login switch for tf.exe and use the same credentials that I use in visual studio it throws

TF30063: You are not authorized to access https://[account].visualstudio.com/defaultcollection TF30063: You are not authorized to access https://[account].visualstudio.com/defaultcollection

What I am trying to achieve is that I am going to provision a server and then not going to login to visual studio and want my tf to work as it works when logged in to the visual studio online account in the team explorer of my visual studio.

I am an admin of the vsts account and have full right on everything. If there are other ways of doing this possibly authenticate TF.exe using PAT token that would work as well.

I would use tf.exe again for a checkin command from automated builds. Any help in solving this would be appreciated.


回答1:


There is the Check in changes task in TFVC Build Tasks extension that you can use it to check in changes. Also, you can call TF command to check in changes during the build process, it uses build service account.

On the other hand, you can create a console application to check in changes through TFS API (Workspace.CheckIn method), then call this app through command line.




回答2:


I was having the same issue (TF30063) when running tf.exe. For me the solution was:

  • Exit all running instances of Visual Studio
  • Rename %LocalAppData%\Microsoft\Team Foundation\7.0\Cache to %LocalAppData%\Microsoft\Team Foundation\7.0\Cache_old (or you could delete it; but I wanted to preserve the original so I had the option restore it when going back into VS). NB: the 7.0 varies according to which version of TF you're using.
  • Navigate to my project's folder pushd c:\projects\vsts_tfvc_repos\Project123
  • Run tf /collection:myinstance.visualstudio.com /workspace:%computername% /login:myMicrosoftAccount@example.com,myPassword to initialise the session under the correct account Thereafter, everything worked as expected...


来源:https://stackoverflow.com/questions/45106863/tf-exe-authenticate-for-vsts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!