Skip to content

Commit 5d1b84c

Browse files
authored
Merge pull request #107401 from BobbySchmidt2/control-flow-webhook-activity
edit pass: control-flow-webhook-activity
2 parents 0773fec + f22c2ed commit 5d1b84c

File tree

1 file changed

+31
-36
lines changed

1 file changed

+31
-36
lines changed

articles/data-factory/control-flow-webhook-activity.md

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Webhook activity in Azure Data Factory
3-
description: The Webhook activity does not continue execution of the pipeline until it validates the attached dataset with certain criteria the user specifies.
3+
description: The webhook activity doesn't continue execution of the pipeline until it validates the attached dataset with certain criteria the user specifies.
44
services: data-factory
55
documentationcenter: ''
66
author: djpmsft
@@ -14,7 +14,8 @@ ms.date: 03/25/2019
1414
---
1515

1616
# Webhook activity in Azure Data Factory
17-
You can use a webhook activity to control the execution of pipelines through your custom code. Using the webhook activity, customers can call an endpoint and pass a callback URL. The pipeline run waits for the callback to be invoked before proceeding to the next activity.
17+
18+
A webhook activity can control the execution of pipelines through your custom code. With the webhook activity, customers' code can call an endpoint and pass it a callback URL. The pipeline run waits for the callback invocation before it proceeds to the next activity.
1819

1920
## Syntax
2021

@@ -43,34 +44,31 @@ You can use a webhook activity to control the execution of pipelines through you
4344

4445
```
4546

46-
4747
## Type properties
4848

49-
50-
5149
Property | Description | Allowed values | Required
5250
-------- | ----------- | -------------- | --------
53-
name | Name of the web hook activity | String | Yes |
54-
type | Must be set to **WebHook**. | String | Yes |
55-
method | Rest API method for the target endpoint. | String. Supported Types: 'POST' | Yes |
56-
url | Target endpoint and path | String (or expression with resultType of string). | Yes |
57-
headers | Headers that are sent to the request. For example, to set the language and type on a request: "headers" : { "Accept-Language": "en-us", "Content-Type": "application/json" }. | String (or expression with resultType of string) | Yes, Content-type header is required. "headers":{ "Content-Type":"application/json"} |
58-
body | Represents the payload that is sent to the endpoint. | Valid JSON (or expression with resultType of JSON). See the schema of the request payload in [Request payload schema](https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fcontrol-flow-web-activity%23request-payload-schema&data=02%7C01%7Cshlo%40microsoft.com%7Cde517eae4e7f4f2c408d08d6b167f6b1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636891457414397501&sdata=ljUZv5csQQux2TT3JtTU9ZU8e1uViRzuX5DSNYkL0uE%3D&reserved=0) section. | Yes |
59-
authentication | Authentication method used for calling the endpoint. Supported Types are "Basic" or "ClientCertificate." For more information, see [Authentication](https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fdata-factory%2Fcontrol-flow-web-activity%23authentication&data=02%7C01%7Cshlo%40microsoft.com%7Cde517eae4e7f4f2c408d08d6b167f6b1%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636891457414397501&sdata=GdA1%2Fh2pAD%2BSyWJHSW%2BSKucqoAXux%2F4L5Jgndd3YziM%3D&reserved=0) section. If authentication is not required, exclude this property. | String (or expression with resultType of string) | No |
60-
timeout | How long the activity will wait for the 'callBackUri' to be invoked. How long the activity will wait for the ‘callBackUri to be invoked. Default value is 10mins (“00:10:00). Format is Timespan i.e. d.hh:mm:ss | String | No |
61-
Report status on callback | Allows the user the report the failed status of the webhook activity which will mark the activity as failed | Boolean | No |
51+
**name** | The name of the webhook activity. | String | Yes |
52+
**type** | Must be set to "WebHook". | String | Yes |
53+
**method** | The REST API method for the target endpoint. | String. The supported type is "POST". | Yes |
54+
**url** | The target endpoint and path. | A string or an expression with the **resultType** value of a string. | Yes |
55+
**headers** | Headers that are sent to the request. Here's an example that sets the language and type on a request: `"headers" : { "Accept-Language": "en-us", "Content-Type": "application/json" }`. | A string or an expression with the **resultType** value of a string. | Yes. A `Content-Type` header like `"headers":{ "Content-Type":"application/json"}` is required. |
56+
**body** | Represents the payload that is sent to the endpoint. | Valid JSON or an expression with the **resultType** value of JSON. See [Request payload schema](https://docs.microsoft.com/azure/data-factory/control-flow-web-activity#request-payload-schema) for the schema of the request payload. | Yes |
57+
**authentication** | The authentication method used to call the endpoint. Supported types are "Basic" and "ClientCertificate". For more information, see [Authentication](https://docs.microsoft.com/azure/data-factory/control-flow-web-activity#authentication). If authentication isn't required, exclude this property. | A string or an expression with the **resultType** value of a string. | No |
58+
**timeout** | How long the activity waits for the callback specified by **callBackUri** to be invoked. The default value is 10 minutes ("00:10:00"). Values have the TimeSpan format *d*.*hh*:*mm*:*ss*. | String | No |
59+
**Report status on callback** | Lets a user report the failed status of a webhook activity. | Boolean | No |
6260

6361
## Authentication
6462

65-
Below are the supported authentication types in the webhook activity.
63+
A webhook activity supports the following authentication types.
6664

6765
### None
6866

69-
If authentication is not required, do not include the "authentication" property.
67+
If authentication isn't required, don't include the **authentication** property.
7068

7169
### Basic
7270

73-
Specify user name and password to use with the basic authentication.
71+
Specify the username and password to use with basic authentication.
7472

7573
```json
7674
"authentication":{
@@ -82,7 +80,7 @@ Specify user name and password to use with the basic authentication.
8280

8381
### Client certificate
8482

85-
Specify base64-encoded contents of a PFX file and the password.
83+
Specify the Base64-encoded contents of a PFX file and a password.
8684

8785
```json
8886
"authentication":{
@@ -92,55 +90,52 @@ Specify base64-encoded contents of a PFX file and the password.
9290
}
9391
```
9492

95-
### Managed Identity
93+
### Managed identity
9694

97-
Specify the resource uri for which the access token will be requested using the managed identity for the data factory. To call the Azure Resource Management API, use `https://management.azure.com/`. For more information about how managed identities works see the [managed identities for Azure resources overview page](/azure/active-directory/managed-identities-azure-resources/overview).
95+
Use the data factory's managed identity to specify the resource URI for which the access token is requested. To call the Azure Resource Management API, use `https://management.azure.com/`. For more information about how managed identities work, see the [managed identities for Azure resources overview](/azure/active-directory/managed-identities-azure-resources/overview).
9896

9997
```json
10098
"authentication": {
101-
"type": "MSI",
102-
"resource": "https://management.azure.com/"
99+
"type": "MSI",
100+
"resource": "https://management.azure.com/"
103101
}
104102
```
105103

106104
> [!NOTE]
107-
> If your data factory is configured with a git repository, you must store your credentials in Azure Key Vault to use basic or client certificate authentication. Azure Data Factory doesn't store passwords in git.
105+
> If your data factory is configured with a Git repository, you must store your credentials in Azure Key Vault to use basic or client-certificate authentication. Azure Data Factory doesn't store passwords in Git.
108106
109107
## Additional notes
110108

111-
Azure Data Factory will pass an additional property callBackUri in the body to the url endpoint, and will expect this uri to be invoked before the timeout value specified. If the uri is not invoked, the activity will fail with status TimedOut.
109+
Data Factory passes the additional property **callBackUri** in the body sent to the URL endpoint. Data Factory expects this URI to be invoked before the specified timeout value. If the URI isn't invoked, the activity fails with the status "TimedOut".
112110

113-
The webhook activity itself fails when the call to the custom endpoint fails. Any error message can be added into the body of the callback and used in a subsequent activity.
111+
The webhook activity fails when the call to the custom endpoint fails. Any error message can be added to the callback body and used in a later activity.
114112

115-
Further for every REST API call the client will timeout if the endpoint doesn't respond in 1 min. This is standard http best practice.
116-
To fix this issue, you need to implement 202 pattern in this case where the endpoint will return 202 (Accepted) and the client will poll.
113+
For every REST API call, the client times out if the endpoint doesn't respond within one minute. This behavior is standard HTTP best practice. To fix this problem, implement a 202 pattern. In the current case, the endpoint returns 202 (Accepted) and the client polls.
117114

118-
The 1 min timeout on the request doesn't have anything to do with the activity timeout. That will be used to wait for the callbackUri.
115+
The one-minute timeout on the request has nothing to do with the activity timeout. The latter is used to wait for the callback specified by **callbackUri**.
119116

120-
The body passed back to the callback URI should be valid JSON. You must set the Content-Type header to `application/json`.
117+
The body passed back to the callback URI must be valid JSON. Set the `Content-Type` header to `application/json`.
121118

122-
When you use the "Report status on callback" option, you must add the following snippet to the body when making the callback:
119+
When you use the **Report status on callback** property, you must add the following code to the body when you make the callback:
123120

124-
```
121+
```json
125122
{
126123
"Output": {
127-
// output object will be used in activity output
124+
// output object is used in activity output
128125
"testProp": "testPropValue"
129126
},
130127
"Error": {
131128
// Optional, set it when you want to fail the activity
132129
"ErrorCode": "testErrorCode",
133130
"Message": "error message to show in activity error"
134131
},
135-
"StatusCode": "403" // when status code is >=400, activity will be marked as failed
132+
"StatusCode": "403" // when status code is >=400, activity is marked as failed
136133
}
137134
```
138135

139-
140-
141136
## Next steps
142137

143-
See other control flow activities supported by Data Factory:
138+
See the following control flow activities supported by Data Factory:
144139

145140
- [If Condition Activity](control-flow-if-condition-activity.md)
146141
- [Execute Pipeline Activity](control-flow-execute-pipeline-activity.md)

0 commit comments

Comments
 (0)