Process parameters

TFS 2018

Note

This guidances does not apply to YAML pipelines. For parameters in YAML pipelines, see runtime parameters.

Process parameters are used in classic pipelines and differ from variables in the kind of input supported by them. Variables only take in string inputs while process parameters in addition to string inputs support more data types like check boxes and drop-down list boxes.

You can link all important arguments for tasks used across the build definition as process parameters, which are then shown at one place - the Pipeline view. This means you can quickly edit these arguments without needing to click through all the tasks.

Templates come with a set of predefined process parameters.

Note

The Link and Unlink functionality applies to build pipelines only. It does not apply to release pipelines.

To set a process parameter, edit your pipeline and go to Tasks > Pipeline.

Screenshot of adding a parameter to a classic task.

Set a process parameter from a template in a build pipeline

You can create a process parameter from a task input in a build pipeline. Process parameters are useful if you will have the same input values in multiple tasks. You can link more arguments across all tasks to new or existing process parameters.

Schematic showing tasks

To link a process parameter:

  1. Select the i icon that is part of a task input field.

  2. In the window that opens, select Link.

    Select the link option in the pop-up.

  3. Configure the Link settings. You can set a new Display name so that you can identify the process parameter later on.

    Update the display name so that you can reference the parameter later.

  4. You'll now have the option to link your process parameter when you reuse the same task. To link a process parameter, select the i icon and click Link.

  5. Set the Process parameter to link to this setting to reference your existing process parameter and select Link.

    Reference an existing process parameter.

You can also unlink arguments from process parameters.

  1. Select the link icon.

  2. Choose the Unlink option. In this example, the Parameter.solution process parameter is unlinked.

Unlink arguments.

Define a new process parameter

You can define a new process parameter using the json definition for your pipeline.

  1. Export the existing template from the Build Definitions page.

    Export the build template.

  2. Open the JSON in a text editor. Add a new input in the process parameter section of your file. If you have existing process parameters, you can duplicate one of them. For example, this is a new parameter definition based on the msBuildArgs parameter.

        {
                "aliases":[
    
                ],
                "options":{
    
                },
                "properties":{
    
                },
                "name":"myNewParam",
                "label":"MyProcessParam",
                "defaultValue":"/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=\"$(build.artifactstagingdirectory)\\\\\"",
                "type":"string",
                "helpMarkDown":"Additional arguments for process parameters.",
                "visibleRule":"",
                "groupName":""
            }
    
  3. Add the new parameter as an input value for any tasks where you want to use it. For example, here the new value of msbuildArgs is myNewParam.

        "inputs":{
                        "solution":"$(Parameters.solution)",
                        "vsVersion":"latest",
                        "msbuildArgs":"$(Parameters.myNewParam)",
                        "platform":"$(BuildPlatform)",
                        "configuration":"$(BuildConfiguration)",
                        "clean":"false",
                        "maximumCpuCount":"false",
                        "restoreNugetPackages":"false",
                        "msbuildArchitecture":"x86",
                        "logProjectEvents":"true",
                        "createLogFile":"false"
                    }
    
  4. Return to the Build Definitions page and select Import.

    Select the import option to add your json file.

  5. Add your json file and import the pipeline.

  6. Within your imported pipeline, you now have the option to link to your new process parameter. You may need to unlink and then link again for the process parameter to appear.