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: articles/data-factory/control-flow-webhook-activity.md
+31-36Lines changed: 31 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
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.
4
4
services: data-factory
5
5
documentationcenter: ''
6
6
author: djpmsft
@@ -14,7 +14,8 @@ ms.date: 03/25/2019
14
14
---
15
15
16
16
# 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.
18
19
19
20
## Syntax
20
21
@@ -43,34 +44,31 @@ You can use a webhook activity to control the execution of pipelines through you
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 resultTypeof 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 resultTypeof 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 resultTypeof 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 resultTypeof 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 |
62
60
63
61
## Authentication
64
62
65
-
Below are the supported authentication types in the webhook activity.
63
+
A webhook activity supports the following authentication types.
66
64
67
65
### None
68
66
69
-
If authentication is not required, do not include the "authentication" property.
67
+
If authentication isn't required, don't include the **authentication** property.
70
68
71
69
### Basic
72
70
73
-
Specify user name and password to use with the basic authentication.
71
+
Specify the username and password to use with basic authentication.
74
72
75
73
```json
76
74
"authentication":{
@@ -82,7 +80,7 @@ Specify user name and password to use with the basic authentication.
82
80
83
81
### Client certificate
84
82
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.
86
84
87
85
```json
88
86
"authentication":{
@@ -92,55 +90,52 @@ Specify base64-encoded contents of a PFX file and the password.
92
90
}
93
91
```
94
92
95
-
### Managed Identity
93
+
### Managed identity
96
94
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).
98
96
99
97
```json
100
98
"authentication": {
101
-
"type": "MSI",
102
-
"resource": "https://management.azure.com/"
99
+
"type": "MSI",
100
+
"resource": "https://management.azure.com/"
103
101
}
104
102
```
105
103
106
104
> [!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 clientcertificate 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.
108
106
109
107
## Additional notes
110
108
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".
112
110
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.
114
112
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.
117
114
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**.
119
116
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`.
121
118
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:
123
120
124
-
```
121
+
```json
125
122
{
126
123
"Output": {
127
-
// output object will be used in activity output
124
+
// output object is used in activity output
128
125
"testProp": "testPropValue"
129
126
},
130
127
"Error": {
131
128
// Optional, set it when you want to fail the activity
132
129
"ErrorCode": "testErrorCode",
133
130
"Message": "error message to show in activity error"
134
131
},
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
136
133
}
137
134
```
138
135
139
-
140
-
141
136
## Next steps
142
137
143
-
See other control flow activities supported by Data Factory:
138
+
See the following control flow activities supported by Data Factory:
0 commit comments