Skip to content

Commit ed3d9cf

Browse files
Merge pull request #8015 from MicrosoftDocs/users/jukullam/uuf-june-9
[uuf] Clarify how steps impact jobs
2 parents c5f36fc + ffc0bfa commit ed3d9cf

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

docs/pipelines/process/runs.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
title: Pipeline runs
33
description: Learn how Azure Pipelines runs jobs, tasks, and scripts.
44
ms.topic: conceptual
5-
ms.custom: devx-track-azurecli
5+
ms.custom: devx-track-azurecli, ai-assisted
66
ms.assetid: 0d207cb2-fcef-49f8-b2bf-ddb4fcf5c47a
7-
ms.date: 07/12/2024
7+
ms.date: 06/09/2025
88
monikerRange: "<=azure-devops"
99
---
1010

@@ -14,19 +14,19 @@ monikerRange: "<=azure-devops"
1414

1515
This article explains the sequence of activities in Azure Pipelines pipeline runs. A run represents one execution of a pipeline. Both continuous integration (CI) and continuous delivery (CD) pipelines consist of runs. During a run, Azure Pipelines processes the pipeline, and [agents](../agents/agents.md) process one or more [jobs, steps, and tasks](../get-started/key-pipelines-concepts.md).
1616

17-
![Diagram showing a pipeline overview.](media/run-overview.png)
17+
![Diagram that shows a pipeline overview.](media/run-overview.png)
1818

1919
For each run, Azure Pipelines:
20-
- Processes the pipeline.
21-
- Requests one or more agents to run jobs.
22-
- Hands off jobs to agents and collects the results.
20+
- Processes the pipeline
21+
- Requests one or more agents to run jobs
22+
- Hands off jobs to agents and collects the results
2323

2424
For each job, an agent:
25-
- Prepares for the job.
26-
- Runs each step in the job.
27-
- Reports results.
25+
- Prepares for the job
26+
- Runs each step in the job
27+
- Reports results
2828

29-
Jobs might succeed, fail, be canceled, or not complete. Understanding these outcomes can help you troubleshoot issues.
29+
Jobs can succeed, fail, be canceled, or not complete. Understanding these outcomes helps you troubleshoot issues.
3030

3131
The following sections describe the pipeline run process in detail.
3232

@@ -57,13 +57,13 @@ As runtime jobs complete, Azure Pipelines checks whether there are new jobs elig
5757

5858
Understanding the processing order clarifies why you can't use certain variables in [template parameters](template-parameters.md). The first template expansion step operates only on the text of the YAML file. Runtime variables don't yet exist during that step. After that step, template parameters are already resolved.
5959

60-
You also can't use [variables](variables.md) to resolve service connection or environment names, because the pipeline authorizes resources before a stage can start running. Stage- and job-level variables aren't available yet. Variable groups are themselves a resource subject to authorization, so their data isn't available when checking resource authorization.
60+
You can't use [variables](variables.md) to resolve service connection or environment names, because the pipeline authorizes resources before a stage starts running. Stage- and job-level variables aren't available yet. Variable groups are themselves a resource subject to authorization, so their data isn't available when checking resource authorization.
6161

6262
You can use pipeline-level variables that are explicitly included in the [pipeline resource definition](/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline). For more information, see [Pipeline resource metadata as predefined variables](/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline#pipeline-resource-metadata-as-predefined-variables).
6363

6464
## Agents
6565

66-
When Azure Pipelines needs to run a job, it requests an [agent](../agents/agents.md) from the [pool](../agents/pools-queues.md). The process works differently for [Microsoft-hosted](../agents/hosted.md) and [self-hosted](../agents/pools-queues.md) agent pools.
66+
Azure Pipelines requests an [agent](../agents/agents.md) from the [pool](../agents/pools-queues.md) to run a job. The process differs for [Microsoft-hosted](../agents/hosted.md) and [self-hosted](../agents/pools-queues.md) agent pools.
6767

6868
>[!NOTE]
6969
>[Server jobs](phases.md#server-jobs) don't use a pool because they run on the Azure Pipelines server itself.
@@ -78,7 +78,7 @@ If there are no available parallel slots, the job has to wait on a slot to free
7878

7979
### Microsoft-hosted agents
8080

81-
Conceptually, the Microsoft-hosted pool is one global pool of machines, although it's physically many different pools split by geography and operating system type. Based on the YAML `vmImage` or Classic editor pool name requested, Azure Pipelines selects an agent.
81+
The Microsoft-hosted pool is conceptually one global pool of machines, but it's physically divided into multiple pools by geography and operating system type. Based on the YAML `vmImage` or Classic editor pool name requested, Azure Pipelines selects an agent.
8282

8383
All agents in the Microsoft pool are fresh, new virtual machines (VMs) that have never run any pipelines. When the job completes, the agent VM is discarded.
8484

@@ -100,15 +100,15 @@ Once an agent accepts a job, it does the following preparation work:
100100
<a name="run-each-step"></a>
101101
## Step execution
102102

103-
The agent runs steps sequentially in order. Before a step can start, all previous steps must be finished or skipped.
103+
The agent runs steps sequentially. Before a step starts, all previous steps must finish or be skipped.
104104

105105
![Diagram that shows running each task.](media/run-tasks.png)
106106

107107
Steps are implemented by [tasks](tasks.md), which can be Node.js, PowerShell, or other scripts. The task system routes inputs and outputs to the backing scripts. Tasks also provide common services such as altering the system path and creating new [pipeline variables](variables.md).
108108

109109
Each step runs in its own process, isolating its environment from previous steps. Because of this process-per-step model, environment variables aren't preserved between steps. However, tasks and scripts can use a mechanism called [logging commands](../scripts/logging-commands.md) to communicate back to the agent. When a task or script writes a logging command to standard output, the agent takes whatever action the command requests.
110110

111-
You can use a logging command to create new pipeline variables. Pipeline variables are automatically converted into environment variables in the next step. A script can set a new variable `myVar` with a value of `myValue` as follows:
111+
You can use a logging command to create new pipeline variables. Pipeline variables automatically convert into environment variables in the next step. A script can set a new variable `myVar` with a value of `myValue` as follows:
112112

113113
```bash
114114
echo '##vso[task.setVariable variable=myVar]myValue'
@@ -130,13 +130,13 @@ The agent can also upload [artifacts](../artifacts/pipeline-artifacts.md) and [t
130130

131131
## State and conditions
132132

133-
The agent keeps track of each step's success or failure. As steps succeed with issues or fail, the job's status is updated. The job always reflects the worst outcome from each of its steps. If a step fails, the job also fails.
133+
The agent keeps track of each step's success or failure. As steps succeed or fail with issues, the job's status is updated. The job always reflects the worst outcome from each of its steps. If a step fails, the job also fails.
134134

135135
Before the agent runs a step, it checks that step's [condition](conditions.md) to determine whether the step should run. By default, a step only runs when the job's status is succeeded or succeeded with issues, but you can set other conditions.
136136

137137
Many jobs have cleanup steps that need to run no matter what else happens, so they can specify a condition of `always()`. Cleanup or other steps can also be set to run only on cancellation.
138138

139-
A successful cleanup step can't save the job from failing. Jobs can never go back to success after entering failure.
139+
A successful cleanup step doesn't save the job from failing. Jobs can't return to success after failing.
140140

141141
## Timeouts and disconnects
142142

@@ -164,7 +164,7 @@ The following examples show how to use the Azure DevOps CLI to list the pipeline
164164

165165
List the pipeline runs in your project with the [az pipelines runs list](/cli/azure/pipelines/runs#az-pipelines-runs-list) command.
166166

167-
The following command lists the first three pipeline runs that have a status of **completed** and a result of **succeeded**, and returns the result in table format.
167+
This command lists the first three pipeline runs with a status of **completed** and a result of **succeeded**, and shows the result in table format.
168168

169169
```azurecli
170170
az pipelines runs list --status completed --result succeeded --top 3 --output table
@@ -180,7 +180,7 @@ Run ID Number Status Result Pipeline ID Pipeline Name
180180

181181
Show the details for a pipeline run in your project with the [az pipelines runs show](/cli/azure/pipelines/runs#az-pipelines-runs-show) command.
182182

183-
The following command shows details for the pipeline run with the ID **123**, returns the results in table format, and opens your web browser to the Azure Pipelines build results page.
183+
This command shows details for the pipeline run with ID **123**, displays the results in table format, and opens your web browser to the Azure Pipelines build results page.
184184

185185
```azurecli
186186
az pipelines runs show --id 122 --open --output table
@@ -218,7 +218,7 @@ YAML
218218

219219
### Delete tag from pipeline run
220220

221-
Delete a tag from a pipeline run in your project with the [az pipelines runs tag delete](/cli/azure/pipelines/runs/tag#az-pipelines-runs-tag-delete) command. The following command deletes the **YAML** tag from the pipeline run with ID **123**.
221+
Delete a tag from a pipeline run in your project using the [az pipelines runs tag delete](/cli/azure/pipelines/runs/tag#az-pipelines-runs-tag-delete) command. This command deletes the **YAML** tag from the pipeline run with ID **123**.
222222

223223
```azurecli
224224
az pipelines runs tag delete --run-id 123 --tag YAML

0 commit comments

Comments
 (0)