0
votes

I'm trying to integrate VSCode with TFS using this Stackoverflow answer.

I have installed the Azure Repos extension and in my settings.json folder, I have done the following:

{
    "tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\CommonExtensions\\Microsoft\\TeamFoundation\\Team Explorer\\TF.exe",
    "tfvc.restrictWorkspace": true
}

While trying to do the team signin portion through the command palette however, I'm prompted with this message:

Provide the username for server (servername:8080)

I enter this and my password, but the connection fails. On the bottom of my VSCode window, I can see this error message when I hover my mouse over the "Team" text:

Failed Request: Service Unavailable(503) - http://servername:8080/tfs/companyprojectcollection/_apis/tfvc/branches

I'm a bit confused. On Visual Studio 2019, to add a server I just had to add the url as http://servername:8080/tfs and login with my credentials, after which I was able to view the workspace/folder that was created for me.

  1. Do I need to edit the initial server it requests me to log into as "http://servername:8080/tfs" instead of "servername:8080", and if so, how?
  2. Why does the error say service unavailable with added folders like companyprojectcollection/_apis/tfvc/branches? How do I fix this?

I could use Visual Stuio 2019, but VSCode is my preferred editor.

EDIT: The error while hovering over the Team button. This is the same format in which I saw the 503 error earlier, except that said "Service Unavailable(503)"

enter image description here

1

1 Answers

1
votes

Failed Request: Service Unavailable(503) - http://servername:8080/tfs/companyprojectcollection/_apis/tfvc/branches

From the error message, it seems that the linked URL has some issue. Generally, the URL to connect to the tfvc repo is like this:

http://servername:8080/tfs/DefaultCollection/tfvcrepo

Here are the steps to link the TFVC repo in VS code:

Step1: Create a workspace and map the workspace to local machine in Visual Studio 2019.

enter image description here

Then the Tfvc Repo will be checked out in the path.

Step2: Open either the root folder or a sub-folder of the TFVC repository (workspace path in step1) in VS code.

enter image description here

Step3: Run the team signin command and input the Username and Password. Then the VS code could connect with the TFVC repo.

enter image description here

In this process, there is no process of customizing the URL, it will automatically recognize the tfvc repo related to the workspace.

Note: the settings.json file is still required for TFVC repo. Your settings are correct.

For mode detailed information, you could refer to this Guidance document.