You can use the Team Foundation Server task to connect to the Team Foundation Server and invoke configured build and test jobs.


  • Verify that the Team Foundation Server endpoint is registered. See the Installation and Configuration guide.

  • Verify that the Team Foundation Server project collection, team projects, and build definitions are configured.


  1. Click the Code Stream tab.
  2. On the Pipelines tab, select an existing pipeline, and click Edit to configure it.
  3. Click the Stages > button.
  4. Click Add Task.
  5. Select Team Foundation Server from the Provider drop-down menu.
  6. Enter a name for the custom task and click OK.
  7. Select the new task in the stage.
  8. Confirm to save the pipeline.
  9. Select when to run the task in the release pipeline.




    Runs the release pipeline task without conditions.

    On Condition(s)

    Runs the release pipeline task only if the defined condition is evaluated as true. If the condition is false, the task is skipped.

    A boolean expression, which uses the following operands and operators, is supported.

    • Pipeline variables such as, ${pipeline.variableName}. Curly brackets are reserved for entering pipeline variables.

    • Task output variables such as, ${Stage1.task1.machines[0].value.hostIp[0]}

    • Default pipeline binding variables such as, ${releasePipelineName}

    • Case insensitive Boolean values such as, true, false, 'true', 'false'

    • Integer or decimal values without quotes

    • String values used with single or double quotes such as, "test", 'test'

    • String and Numeric types of values such as, == Equals and != Not Equals

    • Relational operators such as, >, >=, <, and <=

    • Boolean logic such as, && and ||

    • Arithmetic operators such as, +, -, *, and /

    • Nested expressions using round brackets

    • Strings with literal value ABCD are evaluated as false and the task is skipped.

    Unary operators are not supported.

    A sample condition, ${Stage1.task1.output} == “Passed” || ${pipeline.variableName} == 39

  10. (Optional) Select the Continue Pipeline execution even if this task fails option.

    This option allows the release pipeline to bypass the failed task and continue with the execution process.

  11. Configure the Team Foundation Server properties.




    Provides the registered Team Foundation Server endpoint.

    Project Collection

    Provides a list of existing Team Foundation Server project collections.

    Team Project

    Lists the existing team projects on the Team Foundation Server.

    Build Priority

    Defines the level of priority on when the build runs.

    Build Definition

    Provides a search capability for build definitions with automatic complete.

    When you select the build definition the associated arguments and properties are populated from Team Foundation Server.

  12. Select one or more Team Foundation Server job output properties to expose to other tasks in the release pipeline.

    For example, you can expose the Team Foundation Server build ID and build URL in a deploy task.

Task Output Format for a Team Foundation Server

The following task output format is an example for a Team Foundation Server task.

        "name": "buildId",
        "displayName": "Build Id",
        "value": "823",
        "displayValue": null
        "name": "dropLocation",
        "displayName": "Drop Location",
        "value": "#/70869/drop",
        "displayValue": null
        "name": "logUrl",
        "displayName": "Build Summary Url",
        "value": "",
        "displayValue": ""
        "name": "buildUrl",
        "displayName": "Build Summary Url",
        "value": "",
        "displayValue": ""
        "name": "failedTestsCount",
        "displayName": "Number Of Failed Tests",
        "value": "3",
        "displayValue": null