Written by

Jayakumar Balasubramaniam




see all categories

How to integrate TFS in Visual Studio Code – Part -1

Microsoft has introduced Team Foundation Server Version control for Visual Studio Code. In this blogpost, let us look how to incorporate it into your environment.

TFS control is available as an extension, go to extensions in visual studio code or press Ctrl + Shift + X or use this link https://marketplace.visualstudio.com/items?itemName=ms-vsts.team

Before proceeding next step, make sure you have your Personal Access Token (PAT) with All Scopes available to securely access your TFS account. The latest version of the extension will prompt for your token and store it securely. In previous versions of the extension, you needed to create a token and store it in your Visual Studio Code settings. Please follow this link to get your Access token https://docs.microsoft.com/en-us/vsts/accounts/use-personal-access-tokens-to-authenticate

TFS support for Visual Studio Code relies on TF command line client. You can find the TF command line interface in the below locations,

Previous versions of VS: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\TF.exe       

Latest versions of VS 2017: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe or

C:\Program Files (x86)\Microsoft visualstudio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe

Now let’s configure the TF command line location in Visual studio code settings like below,

configure TF command

To go to Visual Studio code settings, go to “File -> Preferences -> Settings” or press “Ctrl + , (comma)”     

Now we are in last step to provide your TFS credentials, there will be an indicator in the status bar whose message will indicate that you need to sign in. The indicator will be like this: 


Simply click on that indicator, If your repository is on Team Foundation Server 2015 Update 2 or later, you will be prompted to enter your username and password otherwise you will be prompted to enter your personal access token which we got in our second step. Once the credentials are verified it will be stored in your computer securely.

To go to TFS source control in your visual studio code, you can use the press Ctrl + Shift + G or click this icon in your left pane.

TFS source control

Let’s see how to use TFS commands in Visual studio code in out next blog (Part-2) And as always, feel free to reach me out if you have any questions. I would be glad to help.


Jayakumar Balasubramaniam

Written by Jayakumar Balasubramaniam

When deliverables are under the gun, Jayakumar doesn't mind burning the candle at both ends to get the job done. He takes ownership of his tasks, delivers on time and inspires the rest of the team. He loves doing what he does and no wonder he volunteers to code on his laptop even on weekends. He is a Microsoft Certified Professional (MCP) and also actively contributes writing Technical articles to our blog.