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
Copy file name to clipboardExpand all lines: docs/pipelines/process/resources.md
+23-27Lines changed: 23 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,9 @@ Resources allow full [traceability](#traceability) for the services a pipeline u
25
25
26
26
Resources must be authorized to be used in YAML pipelines. Resource owners control the users and pipelines that can access their resources. There are several ways to authorize a YAML pipeline to use resources.
27
27
28
-
- You can use the resource's administration settings to authorize **all pipelines**to access the resource. For example, you can manage secure files and variable groups in the **Library**page under **Pipelines**, and agent pools and service connections in **Project settings**. This authorization is convenient for resources you don't need to restrict, such as test resources.
28
+
- You can use the resource's administration settings to **Grant access permissions to all pipelines**. For example, you can manage secure files and variable groups on the **Pipelines**> **Library** page, and agent pools and service connections in **Project settings** > **Pipelines**. This authorization is convenient for resources you don't need to restrict, such as test resources.
29
29
30
-
- Make sure you have at least **User** role in the [agent pool security roles](../../organizations/security/about-security-roles.md#agent-pool-security-roles-project-level) for your project. YAML pipelines you create are automatically authorized to use resources that you have **User** role on.
30
+
- Make sure you have at least **User** role in the [agent pool security roles](../../organizations/security/about-security-roles.md#agent-pool-security-roles-project-level) for your project. YAML pipelines you create are automatically authorized to use resources where you have **User** role.
31
31
32
32
- If you add a resource definition to a YAML pipeline but the build fails with an error like `Could not find a <resource> with name <resource-name>. The <resource> does not exist or has not been authorized for use`, make sure you have at least **User** role on the resource. You can then choose the option to authorize the resources on the failed build. Once the resource is authorized, you can start a new build.
33
33
@@ -60,21 +60,19 @@ YAML pipeline resources can be:
60
60
-[Repositories](#repositories-resource), or
61
61
-[Webhooks](#webhooks-resource).
62
62
63
-
For complete schema information, see the [resources](/azure/devops/pipelines/yaml-schema/resources) definition in the [YAML schema reference for Azure Pipelines](/azure/devops/pipelines/yaml-schema).
63
+
The following sections provide information and examples for the Azure Pipelines resource categories. For complete schema information, see the [resources](/azure/devops/pipelines/yaml-schema/resources) definition in the [YAML schema reference for Azure Pipelines](/azure/devops/pipelines/yaml-schema).
64
64
65
65
<aname="define-a-pipelines-resource"></a>
66
66
### Pipelines resource
67
67
68
-
If you have a pipeline that produces artifacts, you can consume the artifacts as a `pipelines` resource. Only Azure Pipelines can use the `pipelines` resource. You can use CI `pipeline` resources as [triggers](#triggers) for your CD workflows.
68
+
You can use CI `pipeline` resources as [triggers](#triggers) for your CD workflows. You can also use the `pipeline` label to reference the pipeline resource from other parts of your pipeline, such as to [download artifacts](#pipeline-artifact-download) or [use pipeline resource variables](#pipeline-resource-variables). Only Azure Pipelines can use the `pipelines` resource.
69
69
70
70
In the `pipelines` resource definition:
71
71
-`pipeline` is a unique name you use to reference the pipeline resources.
72
72
-`source` is the name of the pipeline that produced the pipeline artifacts.
73
73
74
74
For complete schema information, see the [resources.pipelines.pipeline](/azure/devops/pipelines/yaml-schema/resources-pipelines-pipeline) definition.
75
75
76
-
You use the `pipeline` label to reference the pipeline resource from other parts of your pipeline, such as to [download artifacts](#pipeline-artifact-download) or [use pipeline resource variables](#pipeline-resource-variables).
77
-
78
76
#### Example pipeline resource definitions
79
77
80
78
The following example resource definition consumes artifacts from a pipeline within the same Azure DevOps project.
@@ -100,7 +98,7 @@ resources:
100
98
<a name="evaluation-of-artifact-version"></a>
101
99
#### Resource version evaluation
102
100
103
-
Azure Pipelines evaluates the default versions for resources based on their resource definitions. A pipeline's default resource artifact versions depend on whether the pipeline runs manually or on schedule, or triggers based on the outcome of the resource run.
101
+
Azure Pipelines evaluates the default versions for resources based on their resource definitions. A pipeline's default resource artifact versions depend on whether the pipeline runs manually or on schedule, or [triggers](#pipeline-resource-triggers) based on the outcome of the resource run.
104
102
105
103
For a manual or scheduled pipeline run, the values of the `version`, `branch`, and `tags` properties in the `pipeline` resource definition define the artifact versions. The `branch` input can't have wildcards, and the `tags` properties use the `AND` operator.
106
104
@@ -135,7 +133,7 @@ resources:
135
133
<a name="triggers"></a>
136
134
#### Pipeline resource triggers
137
135
138
-
For pipeline runs that trigger by the outcome of a resource run, the `trigger` property settings in the resource definition determine the default resource artifact versions. To use a `pipeline` resource as a trigger to run the current pipeline, set the `trigger` property in the `pipeline` resource definition. If you don't include a `trigger` property, resource runs don't trigger current pipeline runs.
136
+
For pipeline runs that trigger on the outcome of a resource run, the `trigger` property settings in the resource definition determine the default resource artifact versions. To use a `pipeline` resource as a trigger to run the current pipeline, you must set the `trigger` property. If you don't include a `trigger` property, resource runs don't trigger current pipeline runs.
139
137
140
138
When a pipeline triggers based on a `trigger` value in a `pipeline` resource definition, the values of the overall resource definition `version`, `branch`, and `tags` properties are ignored. The `trigger` properties determine the artifact versions.
141
139
@@ -144,7 +142,7 @@ When a pipeline triggers based on a `trigger` value in a `pipeline` resource def
144
142
> - If the `pipeline` resource is from the same repository as the current pipeline, or `self`, triggering is on the same branch and commit that raises the triggering event.
145
143
> - If the `pipeline` resource is from a different repository than the current pipeline, triggering is on the default branch of the `pipeline` resource repository.
146
144
147
-
The following table lists the `trigger` properties and how they affect trigger behavior.
145
+
The following table describes how the `trigger` properties affect trigger behavior.
148
146
149
147
|Trigger property | Trigger behavior |
150
148
|---------|---------|
@@ -193,7 +191,7 @@ resources:
193
191
- Production
194
192
```
195
193
196
-
The following example uses `tags` filters for default version evaluation and for `trigger`. The trigger tags use the `AND` operator. The `tags` set in `pipeline` resource definitions are different from the tags set on branches in the Git repository.
194
+
The following example uses `tags` filters for default version evaluation and for the trigger. The `trigger` tags use the `AND` operator. The `tags` set in `pipeline` resource definitions are different from the tags set on branches in the Git repository.
197
195
198
196
```yml
199
197
resources:
@@ -247,7 +245,7 @@ In a regular build job, artifacts don't automatically download. Use `download` e
247
245
248
246
In the `download` step, the optional `artifact` property specifies artifact names. If not specified, all available artifacts download.
249
247
250
-
The optional `patterns` property defines patterns that represent files to include. For full schema information, see the [steps.download](/azure/devops/pipelines/yaml-schema/steps-download) definition.
248
+
The optional `patterns` property defines patterns that represent files to download. For full schema information, see the [steps.download](/azure/devops/pipelines/yaml-schema/steps-download) definition.
251
249
252
250
```yaml
253
251
- job: deploy_windows_x86_agent
@@ -463,9 +461,9 @@ Repos from the `repository` resource aren't automatically synced in your jobs. Y
463
461
<a name="define-a-containers-resource"></a>
464
462
### Containers resource
465
463
466
-
You can use `containers` resources to consume container images in your CI/CD pipelines. A `container` resource can be a public or private Docker registry or Azure Container Registry instance.
464
+
You can use `containers` resources to consume container images in your CI/CD pipelines. A `container` resource can be a public or private Docker registry or an Azure Container Registry instance.
467
465
468
-
You can consume a generic container resource image as part of your jobs, or use it in [container jobs](../process/container-phases.md). If your pipeline requires the support of one or more services, you also need to create and connect to service containers. You can use [volumes](service-containers.md#volumes) to share data between services. For more information, see [Service containers](service-containers.md).
466
+
You can consume a generic container resource image as part of your jobs, or use it in [container jobs](../process/container-phases.md). If your pipeline requires the support of one or more services, you also need to create and connect to [service containers](service-containers.md). You can use [volumes](service-containers.md#volumes) to share data between services.
469
467
470
468
If you need to consume images from a Docker registry, you can define a generic container resource without using a `type` keyword. For example:
471
469
@@ -576,40 +574,38 @@ steps:
576
574
> [!NOTE]
577
575
> Webhooks released in Azure DevOps Server 2020.1.
578
576
579
-
You can consume artifacts and enable automated triggers with pipeline, container, build, and package resources. However, you can't use these resources to automate your deployments based on external events or services.
580
-
581
-
Webhooks automate your workflow based on external webhook events that first-class pipeline, build, container, or package resources don't support. You can subscribe to external events through webhooks and use the events to trigger your pipelines.
577
+
You can use Azure Pipelines pipeline, container, build, and package resources to consume artifacts and automate triggers, but you can't use them to base deployments on external events or services. Webhooks automate your workflow based on external webhook events that first-class Azure Pipelines resources don't support. You can subscribe to external events through webhooks and use the events to trigger your pipelines.
582
578
583
579
The `webhooks` resource in YAML pipelines lets you integrate your pipelines with external services like GitHub, GitHub Enterprise, Nexus, and Artifactory to automate workflows. For on-premises services where Azure DevOps doesn't have visibility into the process, you can configure webhooks on the service to trigger your pipelines automatically.
584
580
585
-
To subscribe to a webhook event, you define a `webhook` resource in your pipeline and point it to an incoming webhook service connection. The following example defines and calls a webhook resource:
581
+
To subscribe to a webhook event, you define a `webhook` resource in your pipeline and specify an incoming webhook service connection. The following example defines and calls a webhook resource:
For complete schema information, see the [resources.webhooks.webhook](/azure/devops/pipelines/yaml-schema/resources-webhooks-webhook) definition.
598
594
599
-
You can consume the JSON payload data in your jobs as variables by using the format `${{ parameters.<WebhookAlias>.<JSONPath>}}`. You can define filters on the webhook resource based on the JSON payload data to customize triggers for each pipeline. Whenever the incoming webhook service connection receives a webhook event, a new run triggers for all the pipelines subscribed to the webhook event.
595
+
You can consume the JSON payload data as variables in your jobs by using the format `${{ parameters.<WebhookAlias>.<JSONPath>}}`. You can define filters on the webhook resource based on the JSON payload data to customize triggers for each pipeline. Whenever the incoming webhook service connection receives a webhook event, a new run triggers for all the pipelines subscribed to that webhook event.
600
596
601
597
#### Webhook trigger configuration
602
598
603
-
To configure webhook triggers, you first set up a webhook on your external service, providing the following information:
599
+
To configure a webhook trigger, you set up a webhook in the external service, providing the following information:
- **Secret** (Optional): If you need to secure your JSON payload, provide a secret value.
602
+
- **Secret** (Optional): If you need to secure the JSON payload, provide a secret value.
607
603
608
-
Next, you create a new incoming webhook service connection. For this service connection type, you define the following information:
604
+
In Azure DevOps **Project Settings** > **Pipelines** > **Service connections**, you create a new incoming webhook service connection. For example, you might define the following information for a GitHub service connection type:
609
605
610
-
- **WebHook Name**: Same as the webhook created in your external service.
611
-
- **Secret** (Optional): Uses the payload's HMAC-SHA1 hash to verify the incoming request. If you used a secret when creating your webhook, you must provide the same secret.
612
-
- **Http Header**: The HTTP header in the request that contains the payload's HMAC-SHA1 hash value for request verification. For example, the GitHub request header is `X-Hub-Signature`.
606
+
- **WebHook Name**: The webhook connection name you created in your external service.
607
+
- **Secret** (optional): The payload's HMAC-SHA1 hash to verify the incoming request. If you used a secret when creating your webhook, you must provide the same secret.
608
+
- **Http Header** (optional): The HTTP header in the request that contains the payload's HMAC-SHA1 hash value for request verification. For example, the GitHub request header is `X-Hub-Signature`.
613
609
614
610

0 commit comments