You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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).
16
16
17
-

17
+

18
18
19
19
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
23
23
24
24
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
28
28
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.
30
30
31
31
The following sections describe the pipeline run process in detail.
32
32
@@ -57,13 +57,13 @@ As runtime jobs complete, Azure Pipelines checks whether there are new jobs elig
57
57
58
58
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.
59
59
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.
61
61
62
62
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).
63
63
64
64
## Agents
65
65
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.
67
67
68
68
>[!NOTE]
69
69
>[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
78
78
79
79
### Microsoft-hosted agents
80
80
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.
82
82
83
83
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.
84
84
@@ -100,15 +100,15 @@ Once an agent accepts a job, it does the following preparation work:
100
100
<aname="run-each-step"></a>
101
101
## Step execution
102
102
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.
104
104
105
105

106
106
107
107
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).
108
108
109
109
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.
110
110
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:
@@ -130,13 +130,13 @@ The agent can also upload [artifacts](../artifacts/pipeline-artifacts.md) and [t
130
130
131
131
## State and conditions
132
132
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.
134
134
135
135
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.
136
136
137
137
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.
138
138
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.
140
140
141
141
## Timeouts and disconnects
142
142
@@ -164,7 +164,7 @@ The following examples show how to use the Azure DevOps CLI to list the pipeline
164
164
165
165
List the pipeline runs in your project with the [az pipelines runs list](/cli/azure/pipelines/runs#az-pipelines-runs-list) command.
166
166
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.
168
168
169
169
```azurecli
170
170
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
180
180
181
181
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.
182
182
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.
184
184
185
185
```azurecli
186
186
az pipelines runs show --id 122 --open --output table
@@ -218,7 +218,7 @@ YAML
218
218
219
219
### Delete tag from pipeline run
220
220
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**.
222
222
223
223
```azurecli
224
224
az pipelines runs tag delete --run-id 123 --tag YAML
0 commit comments