Skip to content

Commit 4967f66

Browse files
committed
review cx
1 parent 437de04 commit 4967f66

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

docs/pipelines/process/conditions.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Pipeline conditions
33
description: Learn about conditions that Azure Pipelines stages, jobs, or steps can run under, and ways to specify those conditions.
44
ms.topic: conceptual
55
ms.assetid: C79149CC-6E0D-4A39-B8D1-EB36C8D3AB89
6-
ms.date: 07/31/2025
6+
ms.date: 08/01/2025
77
monikerRange: '<= azure-devops'
88
#customer intent: As an Azure Pipelines user, I want to understand the conditions that pipeline stages, jobs, and steps can run under, so I can configure builds to run under various conditions.
99
---
@@ -34,7 +34,9 @@ You can override or customize these default behaviors by setting a stage, job, o
3434

3535
The following YAML example demonstrates the `always()` and `failed()` conditions. The first script task in job 1 has an `always` condition, so it runs even if dependencies fail or the build is canceled. In the second script task, `exit job1` forces the `job1` job to fail.
3636

37-
Stages run sequentially, but jobs can run in parallel. To set a condition that depends on the outcome of another job, use `dependsOn`. In the following example, `job2` depends on `job1` and runs because `job1` fails.
37+
Pipeline stages run sequentially by default, but jobs can run in parallel. You can use the `dependsOn` property to explicitly define dependencies between stages or jobs.
38+
39+
To set the conditions for a job that depends on the outcome of another job, use `dependsOn` to define the dependency. In the following example, `job2` depends on `job1` and runs because `job1` fails.
3840

3941
```yaml
4042
jobs:
@@ -50,6 +52,9 @@ jobs:
5052
condition: failed() # this job runs only if job1 fails
5153
```
5254
55+
> [!NOTE]
56+
> You can also use the Azure Pipelines UI to manually run dependent stages when the parent stage fails. For more information, see [Run children stages when parent stage fails](../../release-notes/2024/pipelines/sprint-246-update.md#run-children-stages-when-parent-stage-fails).
57+
5358
## Custom conditions
5459
5560
If the built-in conditions don't meet your needs, you can specify custom conditions as [expressions](expressions.md) in YAML pipeline definitions.
@@ -299,7 +304,7 @@ steps:
299304

300305
You can use parameters in conditions. Parameter expansion happens before the pipeline runs and replaces values surrounded by `${{ }}` with the literal parameter values. Because parameter expansion occurs before condition evaluation, you can declare a parameter in a pipeline and embed the parameter inside any condition in that pipeline.
301306

302-
The `condition` in the following example combines two functions: `succeeded()` and `${{ eq(parameters.doThing, true) }}`. The `succeeded()` function checks if the previous step succeeded. This function returns `true` if there is no previous step.
307+
The `condition` in the following example combines two functions: `succeeded()` and `${{ eq(parameters.doThing, true) }}`. The `succeeded()` function checks if the previous step succeeded. This function also returns `true` if there is no previous step.
303308

304309
The `${{ eq(parameters.doThing, true) }}` function checks whether the `doThing` parameter is equal to `true`. The script step in the following example runs because there was no previous step and `parameters.doThing` is `true` by default.
305310

0 commit comments

Comments
 (0)