Configure Visual Studio Code with VSTS

Visual Studio Code

While in the process of setting up a new environment I thought I would share the steps I took to configure Visual Studio Code (VS-Code) with Visual Studio Team Services (VSTS) online.

Installation

  1. Navigate to: https://code.visualstudio.com
  2. Select the relevant version for your machine e.g. macOS or Windows x64 and click Download
  3. Double click on the installer, if it doesn’t automatically open, follow the wizard
  4. Open Visual Studio Code (VS-Code)
  5. Click on the Extensions icon (left hand side)
  6. Search for Visual Studio Team Services and click Install

Configuration

  • Click on Source Control icon (left hand side)
  • Click on Initialize Repository icon (top-left hand side)
  • Select a folder in which to store the code. For example: C:\Code\Project
  • Click Initialize Repository
  • You will have two options to authenticate: Manually provide a Key or Automatically provide a key…

Manually create a VSTS access token

If you’re not prompted for your Username and Password, follow these instructions on how to create personal access tokens to authenticate access: https://docs.microsoft.com/en-us/vsts/accounts/use-personal-access-tokens-to-authenticate

For ease of use I would recommend using the Automatic approach, however here is how to manually create a VSTS access token.

  • Sign in to either your VSTS account https://account.visualstudio.com
  • from your home page; click on your profile icon and then security details
  • Click Personal access tokens (left hand side) and Add
  • Enter the following:
    • Description: e.g. Bob’s VS-Code Win 10
    • Expires in: e.g. 90 days
    • Accounts: e.g. select the default
    • Authorized Scopes: e.g. All scopes
    • Click Create Token
    • Make a copy of token, e.g. werwqefslz2hhldesdfwfwvsdafqfq2aadsfdpalaifa5ppuyikuik
    • Back to VS-Code
    • Enter the code…

Supporting information