2016-05-06 44 views
2

我使用Team Foundation Server(TFS)VCS根與代理端簽出了TeamCity生成配置。它成功連接到TFS並獲取存儲庫。 TFS帳戶啓用了備用憑據,並且VCS根成功使用這些憑據。當工作區命令工作時,爲什麼TFS歷史命令返回「TF30063:您無權訪問...」

在構建配置中,我有一個使用tf.exe發出TFS命令的Powershell runner步驟。

的第一個命令:

& "$tfExe" workspaces 

執行所成功返回工作區信息($ tfExe設置爲tf.exe路徑)。

獲取庫的歷史與:

& "$tfExe" history . /noprompt /recursive /stopafter:1 /format:detailed 

返回消息:

TF30063: You are not authorized to access https://{projectName}.visualstudio.com/DefaultCollection.

我曾嘗試與不/login參數如下history命令:

& "$tfExe" history . /noprompt /recursive /stopafter:1 /format:detailed /login:"$usernameAndPassword" 

其中我嘗試將$usernameAndPassword設置爲「## Live ## \ AltUserName,Password」和「AltUserName,Password」,但都返回了相同的錯誤。

爲什麼tf.exe可以用於工作區命令,但不能用於歷史命令,以及我使用憑據調用歷史命令的方式有什麼問題(請記住,這些憑證與所用憑據相同由TeamCity中的VCS根目錄)?

+0

是否錯誤顯示運行「和‘$ tfExe’工作區/collection:https://{projectName}.visualstudio.com/DefaultCollection」命令? –

回答

0

首先,請仔細檢查此命令是否可以在CMD中無任何授權錯誤直接成功運行。

而對於/login:選項,請儘量使用/login:username,[password]

+0

不,它沒有。我在那裏得到同樣的錯誤。我不確定TeamCity TFS擴展如何使用相同的憑證來檢查代碼,但是當我嘗試去執行相同的操作時,它不起作用。 –