How to: Upload Build in TFS2017 (Update 1)

This article will guide you through how to upload SPCAF Build in TFS2017 (update 1)

In order to upload your build in TFS2017, you must use the TFX command line. This article will explain what is required in order to do this.

  • Prerequisite.
    • Install Node.js and npm.
    • Install tfx.
    • Unzip the build.
    • Create a Personal Access Token.
  • Upload Build in TFS2017.

Prerequisites

Install Node.js and npm and use this to install tfx-cli.

First, you will need to install Node.js. The installer will also contain npm. Once this is installed on your system you will need to load "Node.js command prompt". Enter the code below to install tfx.

npm install -g tfx-cli

Note: There is currently an issue with the latest version of TFX (as detailed https://github.com/Microsoft/tfs-cli/issues/314)and so you will need to install an older version via the command:

npm install -g tfx-cli@0.6.3

Now unzip the Build to a reasonable location. (which you will need to refer to during the upload process.)

Next, you will need to set up a Personal Access Token (PAT). In order to do this, you will need to login into the TFS Admin Page. Once logged in click on the User icon and go to "Security".

Next click the add button, set a description for the PAT and make sure that you have set the Authorized scopes to "All scopes" and click "Create Token". (as shown below)

The newly created PAT will be displayed. Copy this code and save for future reference.

Upload Build in TFS2017

With the prerequisites done it is time to upload your build. First open Node.js command prompt, with this open you will need to type:

tfx login

The interface will now ask for your URL, which must end in "defaultcollection", it will then prompt for the PAT. Copy the PAT from the prerequisites and paste this in. (Please be aware this will not be displayed as shown below.)

To confirm that you are logged in type the following to confirm all build tasks for the account:

tfx build tasks list

This will display the builds

To finally upload your build you will need to type the following:

tfx build tasks upload

Finally, it will prompt for the location of the build this is the location you unzipped the build to in the prerequisites.

Once complete, a notification will confirm that the upload was successful.

Tags

Pre-Production | Build | Task | Upload | TFS2017 (Update 1) | TFX