Muokkaa

Jaa


Azure Machine Learning as an Event Grid source

This article provides the properties and schema for machine learning workspace events. For an introduction to event schemas, see Azure Event Grid event schema.

Available event types

Azure Machine Learning emits the following event types:

Event type Description
Microsoft.MachineLearningServices.ModelRegistered Raised when a new Model or Model version has been successfully registered.
Microsoft.MachineLearningServices.ModelDeployed Raised when Model(s) have been successfully deployed to an Endpoint.
Microsoft.MachineLearningServices.RunCompleted Raised when a Run has been successfully completed.
Microsoft.MachineLearningServices.DatasetDriftDetected Raised when a Dataset drift monitor detects drift.
Microsoft.MachineLearningServices.RunStatusChanged Raised when a run status changes.

Example events

When an event is triggered, the Event Grid service sends data about that event to subscribing endpoint. This section contains an example of what that data would look like for each event.

Microsoft.MachineLearningServices.ModelRegistered event

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "models/sklearn_regression_model:20",
  "type": "Microsoft.MachineLearningServices.ModelRegistered",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "ModelName": "sklearn_regression_model",
    "ModelVersion": 20,
    "ModelTags": {
        "area": "diabetes",
        "type": "regression"
    },
    "ModelProperties": {
        "type": "test"
    }
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.ModelDeployed event

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "endpoints/my-sklearn-service",
  "type": "Microsoft.MachineLearningServices.ModelDeployed",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "ServiceName": "my-sklearn-service",
    "ServiceComputeType": "ACI",
    "ModelIds": "sklearn_regression_model:1,sklearn_regression_model:2",
    "ServiceTags": {
        "area": "diabetes",
        "type": "regression"
    },
    "ServiceProperties": {
        "type": "test"
    }
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.RunCompleted event

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "experiments/0fa9dfaa-cba3-4fa7-b590-23e48548f5c1/runs/AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
  "type": "Microsoft.MachineLearningServices.RunCompleted",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "experimentId": "0fa9dfaa-cba3-4fa7-b590-23e48548f5c1",
    "experimentName": "automl-local-regression",
    "runId": "AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
    "runType": null,
    "runTags": {},
    "runProperties": {
        "runTemplate": "automl_child",
        "pipeline_id": "5adc0a4fe02504a586f09a4fcbb241f9a4012062",
        "pipeline_spec": "{\"objects\": [{\"class_name\": \"StandardScaler\", \"module\": \"sklearn.preprocessing\", \"param_args\": [], \"param_kwargs\": {\"with_mean\": true, \"with_std\": false}, \"prepared_kwargs\": {}, \"spec_class\": \"preproc\"}, {\"class_name\": \"LassoLars\", \"module\": \"sklearn.linear_model\", \"param_args\": [], \"param_kwargs\": {\"alpha\": 0.001, \"normalize\": true}, \"prepared_kwargs\": {}, \"spec_class\": \"sklearn\"}], \"pipeline_id\": \"5adc0a4fe02504a586f09a4fcbb241f9a4012062\"}",
        "training_percent": "100",
        "predicted_cost": "0.062226144097381045",
        "iteration": "5",
        "run_template": "automl_child",
        "run_preprocessor": "StandardScalerWrapper",
        "run_algorithm": "LassoLars",
        "conda_env_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/conda_env_v_1_0_0.yml",
        "model_name": "AutoMLad912b2d65",
        "scoring_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/scoring_file_v_1_0_0.py",
        "model_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/model.pkl"
    }
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.DatasetDriftDetected event

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "datadrifts/{}/runs/{}",
  "type": "Microsoft.MachineLearningServices.DatasetDriftDetected",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "DataDriftId": "01d29aa4-e6a4-470a-9ef3-66660d21f8ef",
    "DataDriftName": "myDriftMonitor",
    "RunId": "01d29aa4-e6a4-470a-9ef3-66660d21f8ef_1571590300380",
    "BaseDatasetId": "3c56d136-0f64-4657-a0e8-5162089a88a3",
    "TargetDatasetId": "d7e74d2e-c972-4266-b5fb-6c9c182d2a74",
    "DriftCoefficient": 0.83503490684792081,
    "StartTime": "2019-07-04T00:00:00+00:00",
    "EndTime": "2019-07-05T00:00:00+00:00"
  },
  "specversion": "1.0"
}]

Microsoft.MachineLearningServices.RunStatusChanged event

[{
  "source": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Microsoft.MachineLearningServices/workspaces/{workspace-name}",
  "subject": "experiments/0fa9dfaa-cba3-4fa7-b590-23e48548f5c1/runs/AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
  "type": "Microsoft.MachineLearningServices.RunStatusChanged",
  "time": "2017-06-26T18:41:00.9584103Z",
  "id": "831e1650-001e-001b-66ab-eeb76e069631",
  "data": {
    "experimentId": "0fa9dfaa-cba3-4fa7-b590-23e48548f5c1",
    "experimentName": "automl-local-regression",
    "runId": "AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5",
    "runType": null,
    "runTags": {},
    "runProperties": {
        "runTemplate": "automl_child",
        "pipeline_id": "5adc0a4fe02504a586f09a4fcbb241f9a4012062",
        "pipeline_spec": "{\"objects\": [{\"class_name\": \"StandardScaler\", \"module\": \"sklearn.preprocessing\", \"param_args\": [], \"param_kwargs\": {\"with_mean\": true, \"with_std\": false}, \"prepared_kwargs\": {}, \"spec_class\": \"preproc\"}, {\"class_name\": \"LassoLars\", \"module\": \"sklearn.linear_model\", \"param_args\": [], \"param_kwargs\": {\"alpha\": 0.001, \"normalize\": true}, \"prepared_kwargs\": {}, \"spec_class\": \"sklearn\"}], \"pipeline_id\": \"5adc0a4fe02504a586f09a4fcbb241f9a4012062\"}",
        "training_percent": "100",
        "predicted_cost": "0.062226144097381045",
        "iteration": "5",
        "run_template": "automl_child",
        "run_preprocessor": "StandardScalerWrapper",
        "run_algorithm": "LassoLars",
        "conda_env_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/conda_env_v_1_0_0.yml",
        "model_name": "AutoMLad912b2d65",
        "scoring_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/scoring_file_v_1_0_0.py",
        "model_data_location": "aml://artifact/ExperimentRun/dcid.AutoML_ad912b2d-6467-4f32-a616-dbe4af6dd8fc_5/outputs/model.pkl"
    },
   "runStatus": "failed"
   },
  "specversion": "1.0"
}]

Event properties

An event has the following top-level data:

Property Type Description
source string Full resource path to the event source. This field isn't writeable. Event Grid provides this value.
subject string Publisher-defined path to the event subject.
type string One of the registered event types for this event source.
time string The time the event is generated based on the provider's UTC time.
id string Unique identifier for the event.
data object Blob storage event data.
specversion string CloudEvents schema specification version.

The data object has the following properties for each event type:

Microsoft.MachineLearningServices.ModelRegistered

Property Type Description
ModelName string The name of the model that was registered.
ModelVersion string The version of the model that was registered.
ModelTags object The tags of the model that was registered.
ModelProperties object The properties of the model that was registered.

Microsoft.MachineLearningServices.ModelDeployed

Property Type Description
ServiceName string The name of the deployed service.
ServiceComputeType string The compute type (for example, ACI, AKS) of the deployed service.
ModelIds string A comma-separated list of model IDs. The IDs of the models deployed in the service.
ServiceTags object The tags of the deployed service.
ServiceProperties object The properties of the deployed service.

Microsoft.MachineLearningServices.RunCompleted

Property Type Description
experimentId string The ID of the experiment that the run belongs to.
experimentName string The name of the experiment that the run belongs to.
runId string The ID of the Run that was completed.
runType string The Run Type of the completed Run.
runTags object The tags of the completed Run.
runProperties object The properties of the completed Run.

Microsoft.MachineLearningServices.DatasetDriftDetected

Property Type Description
DataDriftId string The ID of the data drift monitor that triggered the event.
DataDriftName string The name of the data drift monitor that triggered the event.
RunId string The ID of the Run that detected data drift.
BaseDatasetId string The ID of the base Dataset used to detect drift.
TargetDatasetId string The ID of the target Dataset used to detect drift.
DriftCoefficient double The coefficient result that triggered the event.
StartTime datetime The start time of the target dataset time series that resulted in drift detection.
EndTime datetime The end time of the target dataset time series that resulted in drift detection.

Microsoft.MachineLearningServices.RunStatusChanged

Property Type Description
experimentId string The ID of the experiment that the run belongs to.
experimentName string The name of the experiment that the run belongs to.
runId string The ID of the Run that was completed.
runType string The Run Type of the completed Run.
runTags object The tags of the completed Run.
runProperties object The properties of the completed Run.
runStatus string The status of the Run.

Tutorials and how-tos

Title Description
Consume Azure Machine Learning events Overview of integrating Azure Machine Learning with Event Grid.

Next steps