Skip to content

Commit 9950842

Browse files
authored
Merge pull request #269620 from Blackmist/214798-eventhub-ga
214798 eventhub ga
2 parents 5279cdd + 229cbc6 commit 9950842

File tree

2 files changed

+29
-31
lines changed

2 files changed

+29
-31
lines changed

articles/machine-learning/how-to-use-event-grid.md

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
---
2-
title: Trigger events in ML workflows (preview)
2+
title: Trigger events in ML workflows
33
titleSuffix: Azure Machine Learning
44
description: Set up event-driven applications, processes, or CI/CD machine learning workflows in Azure Machine Learning.
55
services: machine-learning
66
ms.service: machine-learning
77
ms.subservice: mlops
88
ms.topic: how-to
99
ms.custom: devx-track-azurecli
10-
ms.author: vaidyas
11-
author: vaidya-s
10+
ms.author: truptiparkar
11+
author: truptiparkar7
1212
ms.reviewer: larryfr
13-
ms.date: 01/05/2024
13+
ms.date: 03/26/2024
1414
monikerRange: 'azureml-api-2 || azureml-api-1'
1515
---
1616

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
1818

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).
2020

2121
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.
2222

@@ -26,15 +26,15 @@ When to use Event Grid for event driven actions:
2626
* Streaming events from Azure Machine Learning to various of endpoints
2727
* Trigger an ML pipeline when drift is detected
2828

29-
[!INCLUDE [machine-learning-preview-generic-disclaimer](includes/machine-learning-preview-generic-disclaimer.md)]
29+
[!INCLUDE [machine-learning-preview-generic-disclaimer](includes/machine-learning-preview-items-disclaimer.md)]
3030

3131
## Prerequisites
3232

33-
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.
3434

3535
## The event model & types
3636

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.
3838

3939
![Azure Event Grid functional model](./media/concept-event-grid-integration/azure-event-grid-functional-model.png)
4040

@@ -47,23 +47,23 @@ Azure Machine Learning provides events in the various points of machine learning
4747
| Event type | Description |
4848
| ---------- | ----------- |
4949
| `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 |
5353
| `Microsoft.MachineLearningServices.RunStatusChanged` | Raised when a run status is changed |
5454

5555
### Filter & subscribe to events
5656

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).
5858

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).
6060

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.
6262

6363

6464
1. Go to the Azure portal, select a new subscription or an existing one.
6565
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.
6767

6868
:::image type="content" source="media/how-to-use-event-grid/select-event-filters.png" alt-text="filter events":::
6969

@@ -75,14 +75,12 @@ Subscriptions for Azure Machine Learning events are protected by Azure role-base
7575
| Event type | Subject format | Sample subject |
7676
| ---------- | ----------- | ----------- |
7777
| `Microsoft.MachineLearningServices.RunCompleted` | `experiments/{ExperimentId}/runs/{RunId}` | `experiments/b1d7966c-f73a-4c68-b846-992ace89551f/runs/my_exp1_1554835758_38dbaa94` |
78-
| `Microsoft.MachineLearningServices.ModelRegistered` | `models/{modelName}:{modelVersion}` | `models/sklearn_regression_model:3` |
79-
| `Microsoft.MachineLearningServices.ModelDeployed` | `endpoints/{serviceId}` | `endpoints/my_sklearn_aks` |
80-
| `Microsoft.MachineLearningServices.DatasetDriftDetected` | `datadrift/{data.DataDriftId}/run/{data.RunId}` | `datadrift/4e694bf5-712e-4e40-b06a-d2a2755212d4/run/my_driftrun1_1550564444_fbbcdc0f` |
78+
| `Microsoft.MachineLearningServices.ModelRegistered` (preview) | `models/{modelName}:{modelVersion}` | `models/sklearn_regression_model:3` |
79+
| `Microsoft.MachineLearningServices.ModelDeployed` (preview) | `endpoints/{serviceId}` | `endpoints/my_sklearn_aks` |
80+
| `Microsoft.MachineLearningServices.DatasetDriftDetected` (preview) | `datadrift/{data.DataDriftId}/run/{data.RunId}` | `datadrift/4e694bf5-712e-4e40-b06a-d2a2755212d4/run/my_driftrun1_1550564444_fbbcdc0f` |
8181
| `Microsoft.MachineLearningServices.RunStatusChanged` | `experiments/{ExperimentId}/runs/{RunId}` | `experiments/b1d7966c-f73a-4c68-b846-992ace89551f/runs/my_exp1_1554835758_38dbaa94` |
8282

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). 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:
8684

8785
```
8886
--advanced-filter data.ModelTags.key1 StringIn ('value1')
@@ -101,12 +99,12 @@ Applications that handle Machine Learning events should follow a few recommended
10199
> * Ignore fields you don't understand. This practice will help keep you resilient to new features that might be added in the future.
102100
> * 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.
103101
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:
105103
* Azure Functions
106104
* Azure Logic Apps
107105
* Azure Event Hubs
108106
* 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
110108

111109
## Set up in Azure portal
112110

@@ -116,15 +114,15 @@ Azure Event Grid allows customers to build de-coupled message handlers, which ca
116114

117115
:::image type="content" source="./media/how-to-use-event-grid/select-event.png" alt-text="Screenshot showing the Event Subscription selection.":::
118116

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.
120118

121119
:::image type="content" source="./media/how-to-use-event-grid/add-event-type-updated.png" alt-text="Screenshot of the Create Event Subscription form.":::
122120

123121
1. Select the endpoint to publish the event to. In the following screenshot, __Event hub__ is the selected endpoint:
124122

125123
![Screenshot shows the Create Event Subscription pane with Select Event Hub open.](./media/how-to-use-event-grid/select-event-handler.png)
126124

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.
128126

129127

130128
### Set up with the CLI
@@ -166,7 +164,7 @@ Use [Azure Logic Apps](../logic-apps/index.yml) to configure emails for all your
166164

167165
![Screenshot shows the When a resource event occurs dialog box with machine learning selected as a resource type.](./media/how-to-use-event-grid/select-topic-type.png)
168166

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__.
170168

171169
:::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.":::
172170

@@ -187,7 +185,7 @@ Use [Azure Logic Apps](../logic-apps/index.yml) to configure emails for all your
187185
> [!IMPORTANT]
188186
> 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).
189187
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.
191189

192190
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.
193191

@@ -196,7 +194,7 @@ Before you begin, perform the following actions:
196194
* Set up a dataset monitor to [detect data drift (SDK/CLI v1)](v1/how-to-monitor-datasets.md) in a workspace
197195
* Create a published [Azure Data Factory pipeline](../data-factory/index.yml).
198196

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).
200198

201199
:::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.":::
202200

@@ -208,7 +206,7 @@ In this example, a simple Data Factory pipeline is used to copy files into a blo
208206

209207
![Screenshot shows the Logic App Create pane.](./media/how-to-use-event-grid/set-up-logic-app-for-adf.png)
210208

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__.
212210

213211
![Screenshot shows the Logic Apps Designer with Start with a common trigger options, including When an Event Grid resource event occurs.](./media/how-to-use-event-grid/select-event-grid-trigger.png)
214212

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

225223
![Screenshot shows the Create a pipeline run pane with various values.](./media/how-to-use-event-grid/specify-adf-pipeline.png)
226224

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**.
228226

229227
![Screenshot shows events with the Logic App highlighted.](./media/how-to-use-event-grid/show-logic-app-webhook.png)
230228

-46.7 KB
Loading

0 commit comments

Comments
 (0)