Skip to main content
Version: Deploy 22.2

Install build task in Microsoft VSTS/TFS

This topic provides information about setting up the Deploy plugin for Visual Studio Team Services. Before using the Deploy plugin for Visual Studio Team Services, you must install the Deploy build task in your on-premises Team Foundation Server (TFS) or in Microsoft Visual Studio Team Services (VSTS) server, which is also known as Visual Studio Online (VSO).

Install the build task using the Visual Studio Marketplace

If you use Visual Studio Team Services (VSTS), it is recommended that you install the Deploy extension through the Visual Studio Marketplace.

Install the build task using the TFS CLI

If you use on-premises TFS or VSTS/VSO, you can use the Microsoft TFS Cross Platform Command Line Interface (CLI) to upload the Deploy build task. This application requires NodeJS, npm (which is included with the NodeJS installer), and Java Runtime.

After installing NodeJS, install the TFS CLI with the following command:

npm install -g tfx-cli

Log in using either:

  • Personal access tokens for Visual Studio Online (VSO)
  • Basic authentication for on-premises TFS

Log in to VSO

To log in to Visual Studio Online (VSO):

  1. Follow the instructions at Using Personal Access Tokens to access Visual Studio Online to create a personal access token.
  2. Execute the following command:
    tfs login
  3. You will be prompted to enter the service URL. Provide a value such as https://youraccount.visualstudio.com/DefaultCollection.

Log in to on-premises TFS

To log in to on-premises Team Foundation Server (TFS) 2015:

  1. Follow the instructions at Using tfx against Team Foundation Server (TFS) 2015 using Basic Authentication to enable basic authentication in the TFS virtual application in IIS.
  2. Execute the following command:
    tfx login --auth-type basic
  3. You will be prompted to enter the service URL and the user name and password of the account that has sufficient rights to upload build tasks. Note: You must be in the top-level Agent Pool Administrators group to manipulate tasks.

Upload the Deploy build task

  1. Before uploading the Deploy build task, download the TFS 2015 Deploy ZIP file from the Deploy/Release Software Distribution site and unzip it.
  2. Specify the directory (fully qualified or relative) that contains the files.
  3. Go to the vsts-xld-buildtask folder and execute the following command:
    tfx build tasks upload --task-path xld

Development tooling

After you clone the vsts-xld-buildtask repository, you can script with any tool. It is recommended that you use Visual Studio Code, a free, cross-platform tool that includes an extension for writing PowerShell scripts. To install the PowerShell extension in Visual Studio Code:

  1. Press CTRL+SHIFT+P.
  2. Type ext install, then press ENTER.
  3. Type power.