Written by

Jayakumar Balasubramaniam

Share

  

Category

see all categories
Request Demo

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: 

Team

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

A technology evangelist working on Microsoft 365, SharePoint & Azure. Gets my hands dirty with latest and greatest of SharePoint, Azure & front-end frameworks. Currently working with “Hubfly – A unified digital workplace” as a Product Engineer. Getting in to the depth of the domain & technology, with my eyes for perfection, ensures that the product releases go right every time.