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
Event-driven architecture (EDA) is a common data integration pattern that involves production, detection, consumption, and reaction to events. Data integration scenarios often require Azure Data Factory customers to trigger pipelines when certain events occur. Data Factory native integration with [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) now covers [custom topics](../event-grid/custom-topics.md). You send events to an event grid topic. Data Factory subscribes to the topic, listens, and then triggers pipelines accordingly.
18
-
19
-
> [!NOTE]
20
-
> The integration described in this article depends on [Azure Event Grid](https://azure.microsoft.com/services/event-grid/). Make sure that your subscription is registered with the Event Grid resource provider. For more information, see [Resource providers and types](../azure-resource-manager/management/resource-providers-and-types.md#azure-portal). You must be able to do the `Microsoft.EventGrid/eventSubscriptions/` action. This action is part of the [EventGrid EventSubscription Contributor](../role-based-access-control/built-in-roles.md#eventgrid-eventsubscription-contributor) built-in role.
17
+
Event-driven architecture is a common data integration pattern that involves production, detection, consumption, and reaction to events. Data integration scenarios often require Azure Data Factory customers to trigger pipelines when certain events occur. Data Factory native integration with [Azure Event Grid](https://azure.microsoft.com/services/event-grid/) now covers [custom topics](../event-grid/custom-topics.md). You send events to an Event Grid topic. Data Factory subscribes to the topic, listens, and then triggers pipelines accordingly.
21
18
19
+
The integration described in this article depends on [Azure Event Grid](https://azure.microsoft.com/services/event-grid/). Make sure that your subscription is registered with the Event Grid resource provider. For more information, see [Resource providers and types](../azure-resource-manager/management/resource-providers-and-types.md#azure-portal). You must be able to do the `Microsoft.EventGrid/eventSubscriptions/` action. This action is part of the [EventGrid EventSubscription Contributor](../role-based-access-control/built-in-roles.md#eventgrid-eventsubscription-contributor) built-in role.
22
20
23
21
> [!IMPORTANT]
24
-
> If you are using this feature in Azure Synapse Analytics, please ensure that your subscription is also registered with Data Factory resource provider, or otherwise you will get an error stating that _the creation of an "Event Subscription" failed_.
25
-
22
+
> If you're using this feature in Azure Synapse Analytics, ensure that your subscription is also registered with a Data Factory resource provider. Otherwise, you get a message stating that "the creation of an Event Subscription failed."
26
23
27
-
If you combine pipeline parameters and a custom event trigger, you can parse and reference custom `data` payloads in pipeline runs. Because the `data` field in a custom event payload is a free-form, JSON key-value structure, you can control event-driven pipeline runs.
24
+
If you combine pipeline parameters and a custom event trigger, you can parse and reference custom `data` payloads in pipeline runs. Because the `data` field in a custom event payload is a freeform, JSON key-value structure, you can control event-driven pipeline runs.
28
25
29
26
> [!IMPORTANT]
30
-
> If a key referenced in parameterization is missing in the custom event payload, `trigger run`will fail. You'll get an error that states the expression cannot be evaluated because property`keyName` doesn't exist. In this case, **no**`pipeline run`will be triggered by the event.
27
+
> If a key referenced in parameterization is missing in the custom event payload, `trigger run`fails. You get a message that states the expression can't be evaluated because the`keyName`property doesn't exist. In this case, **no**`pipeline run`is triggered by the event.
31
28
32
29
## Set up a custom topic in Event Grid
33
30
34
31
To use the custom event trigger in Data Factory, you need to *first* set up a [custom topic in Event Grid](../event-grid/custom-topics.md).
35
32
36
-
Go to Azure Event Grid and create the topic yourself. For more information on how to create the custom topic, see Azure Event Grid [portal tutorials](../event-grid/custom-topics.md#azure-portal-tutorials) and [CLI tutorials](../event-grid/custom-topics.md#azure-cli-tutorials).
33
+
Go to Event Grid and create the topic yourself. For more information on how to create the custom topic, see Event Grid [portal tutorials](../event-grid/custom-topics.md#azure-portal-tutorials) and [Azure CLI tutorials](../event-grid/custom-topics.md#azure-cli-tutorials).
37
34
38
35
> [!NOTE]
39
-
> The workflow is different from Storage Event Trigger. Here, Data Factory doesn't set up the topic for you.
36
+
> The workflow is different from a storage event trigger. Here, Data Factory doesn't set up the topic for you.
40
37
41
-
Data Factory expects events to follow the [Event Grid event schema](../event-grid/event-schema.md). Make sure event payloads have the following fields:
38
+
Data Factory expects events to follow the [Event Grid event schema](../event-grid/event-schema.md). Make sure that event payloads have the following fields:
42
39
43
40
```json
44
41
[
@@ -59,101 +56,103 @@ Data Factory expects events to follow the [Event Grid event schema](../event-gri
59
56
60
57
## Use Data Factory to create a custom event trigger
61
58
62
-
1. Go to Azure Data Factory and sign in.
59
+
1. Go to Data Factory and sign in.
63
60
64
61
1. Switch to the **Edit** tab. Look for the pencil icon.
65
62
66
63
1. Select **Trigger** on the menu and then select **New/Edit**.
67
64
68
-
1. On the **Add Triggers** page, select **Choose trigger**, and then select **+New**.
65
+
1. On the **Add Triggers** page, select **Choose trigger**, and then select **+New**.
69
66
70
-
1.Select**Custom events** for**Type**.
67
+
1.Under**Type**, select**Custom events**.
71
68
72
-
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-1-creation.png" alt-text="Screenshot of Author page to create a new custom event trigger in Data Factory UI." lightbox="media/how-to-create-custom-event-trigger/custom-event-1-creation-expanded.png":::
69
+
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-1-creation.png" alt-text="Screenshot that shows creating a new custom event trigger in the Data Factory UI." lightbox="media/how-to-create-custom-event-trigger/custom-event-1-creation-expanded.png":::
73
70
74
-
1. Select your custom topic from the Azure subscription dropdown or manually enter the event topic scope.
71
+
1. Select your custom topic from the Azure subscription dropdown list or manually enter the event topic scope.
75
72
76
73
> [!NOTE]
77
-
> To create or modify a custom event trigger in Data Factory, you need to use an Azure account with appropriate role-based access control (Azure RBAC). No additional permission is required. The Data Factory service principal does *not* require special permission to your Event Grid. For more information about access control, see the [Role-based access control](#role-based-access-control) section.
74
+
> To create or modify a custom event trigger in Data Factory, you need to use an Azure account with appropriate Azure role-based access control (Azure RBAC). No other permission is required. The Data Factory service principal does *not* require special permission to your Event Grid. For more information about access control, see the [Role-based access control](#role-based-access-control) section.
78
75
79
-
1. The **Subject begins with** and **Subject ends with** properties allow you to filter for trigger events. Both properties are optional.
76
+
1. The `Subject begins with` and `Subject ends with` properties allow you to filter for trigger events. Both properties are optional.
80
77
81
-
1. Use **+ New** to add **Event Types** to filter on. The list of custom event triggers uses an OR relationship. When a custom event with an `eventType` property that matches one on the list, a pipeline run is triggered. The event type is case insensitive. For example, in the following screenshot, the trigger matches all `copycompleted` or `copysucceeded` events that have a subject that begins with *factories*.
78
+
1. Use **+ New** to add **Event types** to filter on. The list of custom event triggers uses an OR relationship. When a custom event with an `eventType` property matches one on the list, a pipeline run is triggered. The event type is case insensitive. For example, in the following screenshot, the trigger matches all `copycompleted` or `copysucceeded` events that have a subject that begins with *factories*.
82
79
83
-
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-2-properties.png" alt-text="Screenshot of Edit Trigger page to explain Event Types and Subject filtering in Data Factory UI.":::
80
+
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-2-properties.png" alt-text="Screenshot that shows the Edit trigger page to explain Event types and Subject filtering in the Data Factory UI.":::
81
+
82
+
1. A custom event trigger can parse and send a custom `data` payload to your pipeline. You create the pipeline parameters and then fill in the values on the **Parameters** page. Use the format `@triggerBody().event.data._keyName_` to parse the data payload and pass values to the pipeline parameters.
83
+
84
+
For a detailed explanation, see:
84
85
85
-
1. A custom event trigger can parse and send a custom `data` payload to your pipeline. You create the pipeline parameters, and then fill in the values on the **Parameters** page. Use the format `@triggerBody().event.data._keyName_` to parse the data payload and pass values to the pipeline parameters.
86
-
87
-
For a detailed explanation, see the following articles:
88
86
-[Reference trigger metadata in pipelines](how-to-use-trigger-parameterization.md)
89
87
-[System variables in custom event trigger](control-flow-system-variables.md#custom-event-trigger-scope)
90
88
91
-
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-4-trigger-values.png" alt-text="Screenshot of pipeline parameters settings.":::
89
+
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-4-trigger-values.png" alt-text="Screenshot that shows pipeline parameters settings.":::
92
90
93
-
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-3-parameters.png" alt-text="Screenshot of the parameters page to reference data payload in custom event.":::
91
+
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-3-parameters.png" alt-text="Screenshot that shows the parameters page to reference data payload in a custom event.":::
94
92
95
-
1. After you've entered the parameters, select **OK**.
93
+
1. After you enter the parameters, select **OK**.
96
94
97
95
## Advanced filtering
98
96
99
-
Custom event trigger supports advanced filtering capabilities, similar to [Event Grid Advanced Filtering](../event-grid/event-filtering.md#advanced-filtering). These conditional filters allow pipelines to trigger based upon the _values_ of event payload. For instance, you may have a field in the event payload, named _Department_, and pipeline should only trigger if _Department_ equals to _Finance_. You may also specify complex logic, such as _date_ field in list [1, 2, 3, 4, 5], _month_ field __not__ in list [11, 12], _tag_ field contains any of ['Fiscal Year 2021', 'FiscalYear2021', 'FY2021'].
97
+
Custom event triggers support advanced filtering capabilities, similar to [Event Grid advanced filtering](../event-grid/event-filtering.md#advanced-filtering). These conditional filters allow pipelines to trigger based on the _values_ of the event payload. For instance, you might have a field in the event payload named _Department_, and the pipeline should only trigger if _Department_ equals _Finance_. You might also specify complex logic, such as the _date_ field in list [1, 2, 3, 4, 5], the _month_ field *not* in the list [11, 12], and if the _tag_ field contains [Fiscal Year 2021, FiscalYear2021, or FY2021].
100
98
101
-
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-5-advanced-filters.png" alt-text="Screenshot of setting advanced filters for customer event trigger":::
99
+
:::image type="content" source="media/how-to-create-custom-event-trigger/custom-event-5-advanced-filters.png" alt-text="Screenshot that shows setting advanced filters for a customer event trigger.":::
102
100
103
-
As of today custom event trigger supports a __subset__ of [advanced filtering operators](../event-grid/event-filtering.md#advanced-filtering) in Event Grid. Following filter conditions are supported:
101
+
As of today, custom event triggers support a *subset* of [advanced filtering operators](../event-grid/event-filtering.md#advanced-filtering) in Event Grid. The following filter conditions are supported:
104
102
105
-
* NumberIn
106
-
* NumberNotIn
107
-
* NumberLessThan
108
-
* NumberGreaterThan
109
-
* NumberLessThanOrEquals
110
-
* NumberGreaterThanOrEquals
111
-
* BoolEquals
112
-
* StringContains
113
-
* StringBeginsWith
114
-
* StringEndsWith
115
-
* StringIn
116
-
* StringNotIn
103
+
*`NumberIn`
104
+
*`NumberNotIn`
105
+
*`NumberLessThan`
106
+
*`NumberGreaterThan`
107
+
*`NumberLessThanOrEquals`
108
+
*`NumberGreaterThanOrEquals`
109
+
*`BoolEquals`
110
+
*`StringContains`
111
+
*`StringBeginsWith`
112
+
*`StringEndsWith`
113
+
*`StringIn`
114
+
*`StringNotIn`
117
115
118
-
Select **+New** to add new filter conditions.
116
+
Select **+New** to add new filter conditions.
119
117
120
-
Additionally, custom event triggers obey the [same limitations as Event Grid](../event-grid/event-filtering.md#limitations), including:
118
+
Custom event triggers also obey the [same limitations as Event Grid](../event-grid/event-filtering.md#limitations), such as:
121
119
122
-
* 5 advanced filters and 25 filter values across all the filters per custom event trigger
123
-
* 512 characters per string value
124
-
* 5 values for in and not in operators
125
-
*keys cannot have `.` (dot) character in them, for example, `[email protected]`. Currently, there's no support for escape characters in keys.
120
+
* 5 advanced filters and 25 filter values across all the filters per custom event trigger.
121
+
* 512 characters per string value.
122
+
* 5 values for `in` and `not in` operators.
123
+
*Keys can't have the`.` (dot) character in them, for example, `[email protected]`. Currently, there's no support for escape characters in keys.
126
124
* The same key can be used in more than one filter.
127
125
128
-
Data Factory relies upon the latest _GA_version of [Event Grid API](../event-grid/whats-new.md). As new API versions get to GA stage, Data Factory will expand its support for more advanced filtering operators.
126
+
Data Factory relies on the latest general availability (GA) version of the [Event Grid API](../event-grid/whats-new.md). As new API versions get to the GA stage, Data Factory expands its support for more advanced filtering operators.
129
127
130
128
## JSON schema
131
129
132
-
The following table provides an overview of the schema elements that are related to custom event triggers:
130
+
The following table provides an overview of the schema elements that are related to custom event triggers.
133
131
134
132
| JSON element | Description | Type | Allowed values | Required |
135
133
|---|----------------------------|---|---|---|
136
-
|`scope`| The Azure Resource Manager resource ID of the Event Grid topic. | String | Azure Resource Manager ID | Yes |
134
+
|`scope`| The Azure Resource Manager resource ID of the Event Grid topic. | String | Azure Resource Manager ID | Yes.|
137
135
|`events`| The type of events that cause this trigger to fire. | Array of strings || Yes, at least one value is expected. |
138
-
|`subjectBeginsWith`| The `subject` field must begin with the provided pattern for the trigger to fire. For example, _factories_ only fire the trigger for event subjects that start with *factories*. | String || No |
139
-
|`subjectEndsWith`| The `subject` field must end with the provided pattern for the trigger to fire. | String || No |
140
-
|`advancedFilters`| List of JSON blobs, each specifying a filter condition. Each blob specifies `key`, `operatorType`, and `values`. | List of JSON blob|| No |
136
+
|`subjectBeginsWith`| The `subject` field must begin with the provided pattern for the trigger to fire. For example, *factories* only fire the trigger for event subjects that start with *factories*. | String || No.|
137
+
|`subjectEndsWith`| The `subject` field must end with the provided pattern for the trigger to fire. | String || No.|
138
+
|`advancedFilters`| List of JSON blobs, each specifying a filter condition. Each blob specifies `key`, `operatorType`, and `values`. | List of JSON blobs|| No.|
141
139
142
140
## Role-based access control
143
141
144
-
Azure Data Factory uses Azure role-based access control (RBAC) to prohibit unauthorized access. To function properly, Data Factory requires access to:
142
+
Data Factory uses Azure RBAC to prohibit unauthorized access. To function properly, Data Factory requires access to:
143
+
145
144
- Listen to events.
146
145
- Subscribe to updates from events.
147
146
- Trigger pipelines linked to custom events.
148
147
149
-
To successfully create or update a custom event trigger, you need to sign in to Data Factory with an Azure account that has appropriate access. Otherwise, the operation will fail with an _Access Denied_ error.
148
+
To successfully create or update a custom event trigger, you need to sign in to Data Factory with an Azure account that has appropriate access. Otherwise, the operation fails with the message "Access Denied."
150
149
151
-
Data Factory doesn't require special permission to your Event Grid. You also do *not* need to assign special Azure RBAC role permission to the Data Factory service principal for the operation.
150
+
Data Factory doesn't require special permission to your instance of Event Grid. You also do *not* need to assign special Azure RBAC role permission to the Data Factory service principal for the operation.
152
151
153
152
Specifically, you need `Microsoft.EventGrid/EventSubscriptions/Write` permission on `/subscriptions/####/resourceGroups//####/providers/Microsoft.EventGrid/topics/someTopics`.
154
153
155
-
- When authoring in the data factory (in the development environment for instance), the Azure account signed in needs to have the above permission
156
-
- When publishing through [CI/CD](continuous-integration-delivery.md), the account used to publish the ARM template into the testing or production factory needs to have the above permission.
154
+
- When you author in the data factory (in the development environment, for instance), the Azure account signed in needs to have the preceding permission.
155
+
- When you publish through [continuous integration and continuous delivery](continuous-integration-delivery.md), the account used to publish the Azure Resource Manager template into the testing or production factory needs to have the preceding permission.
0 commit comments