Lesson 4 of 4 Model Monitoring in Azure Machine Learning

Alerts and Retraining Triggers

This lesson explains how monitors and Azure Monitor send alerts, how Event Grid events trigger retraining, and how retraining is designed so that it does not release worse models.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish monitor notifications from Azure Monitor alerts.
  • Describe Azure Machine Learning Event Grid events.
  • Explain how an event starts a retraining pipeline.
  • Describe the gates a retrained model must pass.

Monitor notifications

A model monitor's alert_notification section lists email recipients who are notified when a signal breaches its threshold. The notification names the monitor and signal and links to the studio, where the monitoring overview shows each signal's history and the details of the breach.

Email suits human investigation. For automated responses, the same breach is also visible as an event, described below, and the monitoring job's outputs can be queried. Thresholds should be tuned so that notifications are rare enough to be read; a monitor that alerts every day trains people to ignore it.

Azure Monitor alerts for endpoints

Service-level problems are detected with Azure Monitor alert rules on endpoint and deployment metrics, such as P95 latency above 300 ms for 10 minutes, 5xx errors above 1 percent, or CPU utilization above 85 percent. Log alert rules run KQL queries over endpoint logs in Log Analytics. Each rule sends notifications through an action group, which can email, send SMS, call a webhook, start an Azure Function or Logic App, or create an incident in an IT service management tool.

Model monitor notification
WatchesDrift, data quality and model performance
Configured inThe monitor schedule
DeliveryEmail, and events
Choose when Model quality changed
Azure Monitor alert
WatchesLatency, errors, availability and resource use
Configured inAlert rules on metrics or logs
DeliveryAction groups: email, SMS, webhooks, functions, logic apps
Choose when The service is unhealthy

Event-driven retraining

Azure Machine Learning publishes events to Azure Event Grid, including RunCompleted, RunStatusChanged, ModelRegistered and ModelDeployed. A monitoring job that finds a threshold breach is a run whose status and tags record the breach, so an Event Grid subscription on RunStatusChanged, with advanced filters on the monitoring run's tags, can react to it.

  1. A signal breaches its threshold

    The monitoring run records the breach.

  2. Event Grid delivers the event

    A subscription filtered to monitoring breaches matches it.

  3. A handler starts retraining

    An Azure Function or Logic App submits the retraining pipeline job, or calls a GitHub repository_dispatch webhook to start a workflow.

  4. The pipeline trains and evaluates

    It trains on recent data and compares the candidate with the production model.

  5. Release is gated

    The candidate is registered, and deployment waits for evaluation thresholds and approval.

The same mechanism reacts to other events, such as new data arriving in storage (a Blob Storage event) or a model being registered, which can start validation or deployment workflows.

Designing safe retraining

Automatic retraining is valuable only if it cannot make things worse. The following practices keep it safe.

  • Retrain, then evaluate, then decide: a new model must beat the current model on the same held-out data before it can be deployed.
  • Gate deployment: use evaluation thresholds and, for high-impact models, human approval through a GitHub environment.
  • Check data first: a data quality failure should stop retraining rather than start it.
  • Rate-limit: prevent repeated alerts from starting many retraining runs, for example by checking whether one is already running.
  • Combine triggers: scheduled retraining on a regular cadence plus event-driven retraining for significant drift covers both slow and sudden change.
  • Roll out gradually: retrained models follow the same blue-green or mirrored rollout as any other model.
Worked example

Closing the loop

A company wants its churn model retrained automatically when the monitor reports significant data drift on important features, but a retrained model must not reach production unless it is at least as good as the current one and a model owner approves. Retraining runs as an Azure Machine Learning pipeline, and releases run through GitHub Actions.

Create an Event Grid subscription on the workspace for RunStatusChanged events, filtered to the monitor's threshold breaches, with an Azure Function handler that submits the retraining pipeline. The pipeline ends with an evaluation step that compares the candidate with the production model and registers it only if it is at least as good. Registration starts the GitHub release workflow, whose production job uses a GitHub environment with the model owner as required reviewer.

Emailing the team on drift and retraining by hand would not be automatic. Deploying every retrained model straight to production would skip the comparison and approval. Retraining on a fixed weekly schedule alone would not respond to the drift signal.

Check yourself

Which service publishes Azure Machine Learning events such as RunStatusChanged and ModelRegistered to subscribers?

Show answer

Azure Event Grid. A filtered subscription can trigger an Azure Function or logic app that submits the retraining pipeline.

Exam Tips

Remember for the exam

  • Model monitors email recipients on threshold breaches; Azure Monitor alerts cover service health.
  • Event Grid publishes Azure Machine Learning events such as RunStatusChanged and ModelRegistered.
  • A function or logic app on a filtered event can submit the retraining pipeline.
  • Retrained models must be evaluated against production and gated before release.