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/machine-learning/how-to-use-event-grid.md
+29-31Lines changed: 29 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,22 +1,22 @@
1
1
---
2
-
title: Trigger events in ML workflows (preview)
2
+
title: Trigger events in ML workflows
3
3
titleSuffix: Azure Machine Learning
4
4
description: Set up event-driven applications, processes, or CI/CD machine learning workflows in Azure Machine Learning.
5
5
services: machine-learning
6
6
ms.service: machine-learning
7
7
ms.subservice: mlops
8
8
ms.topic: how-to
9
9
ms.custom: devx-track-azurecli
10
-
ms.author: vaidyas
11
-
author: vaidya-s
10
+
ms.author: truptiparkar
11
+
author: truptiparkar7
12
12
ms.reviewer: larryfr
13
-
ms.date: 01/05/2024
13
+
ms.date: 03/26/2024
14
14
monikerRange: 'azureml-api-2 || azureml-api-1'
15
15
---
16
16
17
-
# Trigger applications, processes, or CI/CD workflows based on Azure Machine Learning events (preview)
17
+
# Trigger applications, processes, or CI/CD workflows based on Azure Machine Learning events
18
18
19
-
In this article, you learn how to set up event-driven applications, processes, or CI/CD workflows based on Azure Machine Learning events, such as failure notification emails or ML pipeline runs, when certain conditions are detected by[Azure Event Grid](../event-grid/index.yml).
19
+
In this article, you learn how to set up event-driven applications, processes, or CI/CD workflows based on Azure Machine Learning events. For example, failure notification emails or ML pipeline runs, when certain conditions are detected using[Azure Event Grid](../event-grid/index.yml).
20
20
21
21
Azure Machine Learning manages the entire lifecycle of machine learning process, including model training, model deployment, and monitoring. You can use Event Grid to react to Azure Machine Learning events, such as the completion of training runs, the registration and deployment of models, and the detection of data drift, by using modern serverless architectures. You can then subscribe and consume events such as run status changed, run completion, model registration, model deployment, and data drift detection within a workspace.
22
22
@@ -26,15 +26,15 @@ When to use Event Grid for event driven actions:
26
26
* Streaming events from Azure Machine Learning to various of endpoints
To use Event Grid, you need contributor or owner access to the Azure Machine Learning workspace you will create events for.
33
+
To use Event Grid, you need contributor or owner access to the Azure Machine Learning workspace you create events for.
34
34
35
35
## The event model & types
36
36
37
-
Azure Event Grid reads events from sources, such as Azure Machine Learning and other Azure services. These events are then sent to event handlers such as Azure Event Hubs, Azure Functions, Logic Apps, and others. The following diagram shows how Event Grid connects sources and handlers, but is not a comprehensive list of supported integrations.
37
+
Azure Event Grid reads events from sources, such as Azure Machine Learning and other Azure services. These events are then sent to event handlers such as Azure Event Hubs, Azure Functions, Logic Apps, and others. The following diagram shows how Event Grid connects sources and handlers, but isn't a comprehensive list of supported integrations.
@@ -47,23 +47,23 @@ Azure Machine Learning provides events in the various points of machine learning
47
47
| Event type | Description |
48
48
| ---------- | ----------- |
49
49
|`Microsoft.MachineLearningServices.RunCompleted`| Raised when a machine learning experiment run is completed |
50
-
|`Microsoft.MachineLearningServices.ModelRegistered`| Raised when a machine learning model is registered in the workspace |
51
-
|`Microsoft.MachineLearningServices.ModelDeployed`| Raised when a deployment of inference service with one or more models is completed |
52
-
|`Microsoft.MachineLearningServices.DatasetDriftDetected`| Raised when a data drift detection job for two datasets is completed |
50
+
|`Microsoft.MachineLearningServices.ModelRegistered`(preview) | Raised when a machine learning model is registered in the workspace |
51
+
|`Microsoft.MachineLearningServices.ModelDeployed`(preview) | Raised when a deployment of inference service with one or more models is completed |
52
+
|`Microsoft.MachineLearningServices.DatasetDriftDetected`(preview) | Raised when a data drift detection job for two datasets is completed |
53
53
|`Microsoft.MachineLearningServices.RunStatusChanged`| Raised when a run status is changed |
54
54
55
55
### Filter & subscribe to events
56
56
57
-
These events are published through Azure Event Grid. Using Azure portal, PowerShell or Azure CLI, customers can easily subscribe to events by [specifying one or more event types, and filtering conditions](../event-grid/event-filtering.md).
57
+
These events are published through Azure Event Grid. From the Azure portal, PowerShell, or Azure CLI, you can easily subscribe to events by [specifying one or more event types, and filtering conditions](../event-grid/event-filtering.md).
58
58
59
-
When setting up your events, you can apply filters to only trigger on specific event data. In the example below, for run status changed events, you can filter by run types. The event only triggers when the criteria is met. Refer to the [Azure Machine Learning Event Grid schema](../event-grid/event-schema-machine-learning.md) to learn about event data you can filter by.
59
+
When setting up your events, you can apply filters to only trigger on specific event data. In the following example, for run status changed events, you can filter by run types. The event only triggers when the criteria are met. For more information on the event data you can filter on, see the [Azure Machine Learning Event Grid schema](../event-grid/event-schema-machine-learning.md).
60
60
61
-
Subscriptions for Azure Machine Learning events are protected by Azure role-based access control (Azure RBAC). Only [contributor or owner](how-to-assign-roles.md#default-roles) of a workspace can create, update, and delete event subscriptions. Filters can be applied to event subscriptions either during the [creation](/cli/azure/eventgrid/event-subscription) of the event subscription or at a later time.
61
+
Subscriptions for Azure Machine Learning events are protected by Azure role-based access control (Azure RBAC). Only [contributor or owner](how-to-assign-roles.md#default-roles) of a workspace can create, update, and delete event subscriptions. Filters can be applied to event subscriptions either during the [creation](/cli/azure/eventgrid/event-subscription) of the event subscription or at a later time.
62
62
63
63
64
64
1. Go to the Azure portal, select a new subscription or an existing one.
65
65
1. Select the Events entry from the left navigation area, and then select **+ Event subscription**.
66
-
1. Select the filters tab and scroll down to Advanced filters. For the **Key** and **Value**, provide the property types you want to filter by. Here you can see the event will only trigger when the run type is a pipeline run or pipeline step run.
66
+
1. Select the filters tab and scroll down to Advanced filters. For the **Key** and **Value**, provide the property types you want to filter by. Here you can see the event triggers when the run type is a pipeline run or pipeline step run.
+**Advanced filtering**: Azure Event Grid also supports advanced filtering based on published event schema. Azure Machine Learning event schema details can be found in [Azure Event Grid event schema for Azure Machine Learning](../event-grid/event-schema-machine-learning.md). Some sample advanced filterings you can perform include:
84
-
85
-
For `Microsoft.MachineLearningServices.ModelRegistered` event, to filter model's tag value:
83
+
+**Advanced filtering**: Azure Event Grid also supports advanced filtering based on published event schema. Azure Machine Learning event schema details can be found in [Azure Event Grid event schema for Azure Machine Learning](../event-grid/event-schema-machine-learning.md). For `Microsoft.MachineLearningServices.ModelRegistered` event, to filter model's tag value:
@@ -101,12 +99,12 @@ Applications that handle Machine Learning events should follow a few recommended
101
99
> * Ignore fields you don't understand. This practice will help keep you resilient to new features that might be added in the future.
102
100
> * Failed or cancelled Azure Machine Learning operations will not trigger an event. For example, if a model deployment fails Microsoft.MachineLearningServices.ModelDeployed won't be triggered. Consider such failure mode when design your applications. You can always use Azure Machine Learning SDK, CLI or portal to check the status of an operation and understand the detailed failure reasons.
103
101
104
-
Azure Event Grid allows customers to build de-coupled message handlers, which can be triggered by Azure Machine Learning events. Some notable examples of message handlers are:
102
+
Azure Event Grid allows customers to build decoupled message handlers, which can be triggered by Azure Machine Learning events. Some notable examples of message handlers are:
105
103
* Azure Functions
106
104
* Azure Logic Apps
107
105
* Azure Event Hubs
108
106
* Azure Data Factory Pipeline
109
-
* Generic webhooks, which may be hosted on the Azure platform or elsewhere
107
+
* Generic webhooks, which might be hosted on the Azure platform or elsewhere
110
108
111
109
## Set up in Azure portal
112
110
@@ -116,15 +114,15 @@ Azure Event Grid allows customers to build de-coupled message handlers, which ca
116
114
117
115
:::image type="content" source="./media/how-to-use-event-grid/select-event.png" alt-text="Screenshot showing the Event Subscription selection.":::
118
116
119
-
1. Select the event type to consume. For example, the following screenshot has selected __Model registered__, __Model deployed__, __Run completed__, and __Dataset drift detected__:
117
+
1. Select the event type to consume.
120
118
121
119
:::image type="content" source="./media/how-to-use-event-grid/add-event-type-updated.png" alt-text="Screenshot of the Create Event Subscription form.":::
122
120
123
121
1. Select the endpoint to publish the event to. In the following screenshot, __Event hub__ is the selected endpoint:
124
122
125
123

126
124
127
-
Once you have confirmed your selection, click__Create__. After configuration, these events will be pushed to your endpoint.
125
+
Once you confirm your selection, select__Create__. After configuration, these events will be pushed to your endpoint.
128
126
129
127
130
128
### Set up with the CLI
@@ -166,7 +164,7 @@ Use [Azure Logic Apps](../logic-apps/index.yml) to configure emails for all your
166
164
167
165

168
166
169
-
1. Select which event(s) to be notified for. For example, the following screenshot __RunCompleted__.
167
+
1. Select which event to be notified for. For example, the following screenshot __RunCompleted__.
170
168
171
169
:::image type="content" source="./media/how-to-use-event-grid/select-event-runcomplete.png" alt-text="Screenshot showing the Machine Learning service as the resource type.":::
172
170
@@ -187,7 +185,7 @@ Use [Azure Logic Apps](../logic-apps/index.yml) to configure emails for all your
187
185
> [!IMPORTANT]
188
186
> This example relies on a feature (data drift) that is only available when using Azure Machine Learning SDK v1 or Azure CLI extension v1 for Azure Machine Learning. For more information, see [What is Azure Machine Learning CLI & SDK v2](concept-v2.md).
189
187
190
-
Models go stale over time, and not remain useful in the context it is running in. One way to tell if it's time to retrain the model is detecting data drift.
188
+
Models go stale over time, and not remain useful in the context it's running in. One way to tell if it's time to retrain the model is detecting data drift.
191
189
192
190
This example shows how to use Event Grid with an Azure Logic App to trigger retraining. The example triggers an Azure Data Factory pipeline when data drift occurs between a model's training and serving datasets.
193
191
@@ -196,7 +194,7 @@ Before you begin, perform the following actions:
196
194
* Set up a dataset monitor to [detect data drift (SDK/CLI v1)](v1/how-to-monitor-datasets.md) in a workspace
197
195
* Create a published [Azure Data Factory pipeline](../data-factory/index.yml).
198
196
199
-
In this example, a simple Data Factory pipeline is used to copy files into a blob store and run a published Machine Learning pipeline. For more information on this scenario, see how to set up a [Machine Learning step in Azure Data Factory](../data-factory/transform-data-machine-learning-service.md)
197
+
In this example, a simple Data Factory pipeline is used to copy files into a blob store and run a published Machine Learning pipeline. For more information on this scenario, see how to set up a [Machine Learning step in Azure Data Factory](../data-factory/transform-data-machine-learning-service.md).
200
198
201
199
:::image type="content" source="./media/how-to-use-event-grid/adf-mlpipeline-stage.png" alt-text="Screenshot showing the training pipeline in Azure Data Factory.":::
202
200
@@ -208,7 +206,7 @@ In this example, a simple Data Factory pipeline is used to copy files into a blo
208
206
209
207

210
208
211
-
1. Once you have created the logic app, select __When an Event Grid resource event occurs__.
209
+
1. Once you create the logic app, select __When an Event Grid resource event occurs__.
212
210
213
211

214
212
@@ -224,7 +222,7 @@ In this example, a simple Data Factory pipeline is used to copy files into a blo
224
222
225
223

226
224
227
-
1. Save and create the logic app using the **save** button on the top left of the page. To view your app, go to your workspace in the [Azure portal](https://portal.azure.com) and click on**Events**.
225
+
1. Save and create the logic app using the **save** button on the top left of the page. To view your app, go to your workspace in the [Azure portal](https://portal.azure.com) and select**Events**.
228
226
229
227

0 commit comments