Lesstep
Azure Pipelines · YAML · Checked November 9, 2026

Azure Pipelines: "The 'runTests' parameter value '$(RUN_TESTS)' is not a valid Boolean"

A pipeline passes a variable to a template's boolean parameter, and the run does not start. The variable is not what is wrong: when Azure Pipelines checks the parameter, $(RUN_TESTS) has not been replaced yet, and the text $(RUN_TESTS) is neither true nor false.

What it looks like

Encountered error(s) while parsing pipeline YAML:
/azure-pipelines.yml (Line: 18, Col: 25): The 'runTests' parameter value '$(RUN_TESTS)' is not a valid Boolean.

The line and column point at the value in the template: call. A typical case, with RUN_TESTS kept in a variable group or in the pipeline settings:

# azure-pipelines.yml
variables:
- group: build-settings      # RUN_TESTS = true
jobs:
- template: build.yml
  parameters:
    runTests: $(RUN_TESTS)

# build.yml
parameters:
- name: runTests
  type: boolean
  default: false

The most viewed question on it has been opened about 58,000 times.

When the pipeline is a pull request's build validation, the pull request waits on it: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull request's branch policies with their state in IntelliJ IDEA, Rider or PyCharm, and with Pro runs a failed build policy again once the YAML is fixed. Its Pipelines tab (version 1.0.86 and later) lists the runs of the repositories you have open and opens a failed task's log in the editor, free to read.

Why: templates are expanded before variables

The value is chosen when the run starts: use a runtime parameter

If the variable is there so that someone can switch it on when they run the pipeline, make it a parameter of the pipeline instead. Parameters are known at compile time and keep their type, and the Run pipeline panel asks for them:

# azure-pipelines.yml
parameters:
- name: runTests
  displayName: Run tests?
  type: boolean
  default: false
jobs:
- template: build.yml
  parameters:
    runTests: ${{ parameters.runTests }}

Microsoft's page on runtime parameters uses a boolean parameter the same way.

The variable is written in the YAML: use ${{ variables.name }}

variables:
- name: RUN_TESTS
  value: true
jobs:
- template: build.yml
  parameters:
    runTests: ${{ variables.RUN_TESTS }}

The value only exists at run time: use a string parameter where run-time values work

For a value from a variable group, the pipeline settings or a script, keep the template parameter a string and use it only where the run replaces it:

# build.yml
parameters:
- name: runTests
  type: string
  default: 'false'
steps:
- script: ./build.sh --run-tests=${{ parameters.runTests }}   # becomes $(RUN_TESTS), replaced before the step runs
- script: ./test.sh
  condition: eq(variables['RUN_TESTS'], 'true')                 # decided during the run

A condition is evaluated during the run, so it sees the variable group. The step stays in the job and is shown as skipped when the value is not true, unlike ${{ if }}, which removes it before the run.

Azure DevOps pull requests in IntelliJ IDEA, Rider and PyCharm

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It shows the branch policies of a pull request with their state, so a required build that has not passed is next to its pull request, and with Pro you run a failed or expired build policy again from there. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

Azure DevOps and Azure Pipelines are trademarks of Microsoft Corporation; IntelliJ IDEA, Rider and PyCharm are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.

More: The step name X appears more than once · A template expression is not allowed in this context · Unexpected value 'variables', 'stages' or 'steps' · Build validation · 日本語