Skip to content

Commit dad78d3

Browse files
authored
Merge pull request #107333 from Blackmist/event-grid-update
Event grid update
2 parents 6d8a8de + 8ad9be5 commit dad78d3

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,27 @@ ms.topic: conceptual
99
ms.author: shipatel
1010
author: shivp950
1111
ms.reviewer: larryfr
12-
ms.date: 03/05/2020
12+
ms.date: 03/11/2020
1313
---
1414

1515

1616
# Create event driven machine learning workflows (Preview)
1717

18-
[Azure Event Grid](https://docs.microsoft.com/azure/event-grid/) supports Azure Machine Learning events. For example, you can use events from run completion, model registration, model deployment, and data drift detection scoped to a workspace.
18+
[Azure Event Grid](https://docs.microsoft.com/azure/event-grid/) supports Azure Machine Learning events. You can subscribe and consume events such as run status changed, run completion, model registration, model deployment, and data drift detection within a workspace.
1919

20-
For more information, see [Azure Machine Learning integration with Event Grid](concept-event-grid-integration.md) and the [Azure Machine Learning event grid schema](/azure/event-grid/event-schema-machine-learning).
20+
For more information on event types, see [Azure Machine Learning integration with Event Grid](concept-event-grid-integration.md) and the [Azure Machine Learning event grid schema](/azure/event-grid/event-schema-machine-learning).
2121

2222
Use Event Grid to enable common scenarios such as:
2323

24-
* Send emails on run completion
24+
* Send emails on run failure and run completion
2525
* Use an azure function after a model is registered
2626
* Streaming events from Azure Machine Learning to various of endpoints
2727
* Trigger an ML pipeline when drift is detected
2828

29+
> [!NOTE]
30+
> Currently, runStatusChanged events only trigger when the run status is **failed**
31+
>
32+
2933
## Prerequisites
3034
* Contributor or owner access to the Azure Machine Learning workspace you will create events for.
3135

@@ -39,14 +43,15 @@ Use Event Grid to enable common scenarios such as:
3943

4044
1. Select the event type to consume. For example, the following screenshot has selected __Model registered__, __Model deployed__, __Run completed__, and __Dataset drift detected__:
4145

42-
![add-event-type](./media/how-to-use-event-grid/add-event-type.png)
46+
![add-event-type](./media/how-to-use-event-grid/add-event-type-updated.png)
4347

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

4650
![select-event-handler](./media/how-to-use-event-grid/select-event-handler.png)
4751

4852
Once you have confirmed your selection, click __Create__. After configuration, these events will be pushed to your endpoint.
4953

54+
5055
### Configure EventGrid using the CLI
5156

5257
You can either install the latest [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli?view=azure-cli-latest), or use the Azure Cloud Shell that is provided as part of your Azure subscription.
@@ -72,13 +77,17 @@ az eventgrid event-subscription create \
7277
--subject-begins-with "models/mymodelname"
7378
```
7479

75-
## Sample scenarios
80+
## Filter Events
7681

77-
### Use Azure Functions to deploy a model based on tags
82+
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](/azure/event-grid/event-schema-machine-learning) to learn about event data you can filter by.
7883

79-
An Azure Machine Learning model object contains parameters you can pivot deployments on such as model name, version, tag, and property. The model registration event can trigger an endpoint and you can use an Azure Function to deploy a model based on the value of those parameters.
84+
1. Go to the Azure portal, select a new subscription or an existing one.
8085

81-
For an example, see the [https://github.com/Azure-Samples/MachineLearningSamples-NoCodeDeploymentTriggeredByEventGrid](https://github.com/Azure-Samples/MachineLearningSamples-NoCodeDeploymentTriggeredByEventGrid) repository and follow the steps in the **readme** file.
86+
1. Select the filters tab and scroll down to Advanced filters. In 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.
87+
88+
:::image type="content" source="media/how-to-use-event-grid/select-event-filters.png" alt-text="filter events":::
89+
90+
## Sample scenarios
8291

8392
### Use a Logic App to send email alerts
8493

@@ -96,7 +105,7 @@ Leverage [Azure Logic Apps](https://docs.microsoft.com/azure/logic-apps/) to con
96105

97106
![select-event-runcomplete](./media/how-to-use-event-grid/select-event-runcomplete.png)
98107

99-
1. You can also add filters to only trigger the logic app on a subset of event types. In the following screenshot, a __prefix filter__ of __/datadriftID/runs/__ is used.
108+
1. You can use the filtering method in the section above or add filters to only trigger the logic app on a subset of event types. In the following screenshot, a __prefix filter__ of __/datadriftID/runs/__ is used.
100109

101110
![filter-events](./media/how-to-use-event-grid/filtering-events.png)
102111

@@ -160,6 +169,11 @@ Now the data factory pipeline is triggered when drift occurs. View details on yo
160169

161170
![view-in-workspace](./media/how-to-use-event-grid/view-in-workspace.png)
162171

172+
### Use Azure Functions to deploy a model based on tags
173+
174+
An Azure Machine Learning model object contains parameters you can pivot deployments on such as model name, version, tag, and property. The model registration event can trigger an endpoint and you can use an Azure Function to deploy a model based on the value of those parameters.
175+
176+
For an example, see the [https://github.com/Azure-Samples/MachineLearningSamples-NoCodeDeploymentTriggeredByEventGrid](https://github.com/Azure-Samples/MachineLearningSamples-NoCodeDeploymentTriggeredByEventGrid) repository and follow the steps in the **readme** file.
163177

164178
## Next steps
165179

169 KB
Loading
122 KB
Loading

0 commit comments

Comments
 (0)