Rana Maninder Singh
Lesson 9 of 12Cloud Data & AI Engineering

MLOps and Cloud Automation

Lesson opener

In one line: A model is promotable when a pipeline can rebuild it from a named input and a second person can see the metric. A drift alert is a comparison you defined, not a feeling that the model "got worse."

Why it matters: Northline's scoring image was built on a laptop and copied to the registry by hand. The curated file changed. The endpoint still serves version 3, and nobody measured whether today's SKUs look like the training rows. Figures are illustrative. The drift cutoff below is Northline's choice, not a service default.

Before this lesson: You can name a registered model, a pinned image, and a curated path.

What you will be able to do

Prerequisites

Lessons 6 to 8. You will not stand up a registry in the practice.

Promote, then watch

A pipeline here is the automation that trains or builds from committed code and a named data asset, then pushes an image or registers a model. GitHub Actions can be that pipeline. Azure Pipelines can be that pipeline. The tool is not the control. The control is: the run names the data path, the code revision, the metric, and the image digest.

The model registry in Azure Machine Learning stores versions of a model (https://learn.microsoft.com/en-us/azure/machine-learning/concept-model-management-and-deployment). Promotion means a person or a rule moves a version to the endpoint. It does not mean the newest training job overwrites production by itself.

A feature is an input the model expects, such as units_on_hand at a known as_of. A feature store is a place that defines and serves those inputs so training and scoring use the same definition. Azure Machine Learning documents a managed feature store for that job (https://learn.microsoft.com/en-us/azure/machine-learning/concept-what-is-managed-feature-store). You do not need one on day one. You do need a written definition if two jobs compute "on hand" differently.

Data drift means the inputs now differ from the training inputs in a way you measure. Azure Machine Learning's model monitoring is the product surface for watching a deployed model (https://learn.microsoft.com/en-us/azure/machine-learning/concept-model-monitoring). A share of blank SKUs is a check you can run even before that product is wired. The cutoff is yours.

def drift_blank_sku(blank_rows, total_rows, cutoff):
    if total_rows <= 0:
        raise ValueError("no rows")
    if not 0 <= cutoff <= 1:
        raise ValueError("cutoff must be a share")
    share = blank_rows / total_rows
    return share > cutoff

assert drift_blank_sku(1, 100, 0.05) is False
assert drift_blank_sku(10, 100, 0.05) is True

0.05 means "more than 5 blank SKUs per 100 rows." Northline picked it for this exercise. It is not a law and not an Azure default.

Teacher walkthrough: version 4 does not auto-replace version 3

All figures are illustrative.

  1. The pipeline reads curated/stock/2026-09-30/, revision c12ab, and records metric 0.90 against floor 0.80.
  2. It registers model version 4 and pushes image digest sha256:def with tag 2026-09-30.4.
  3. The endpoint stays on version 3 until a person promotes version 4.
  4. Validation: the registry shows both versions. The endpoint's digest is still version 3's digest. A blank-SKU share of 0.02 does not page anyone. A share of 0.10 does.

A second workplace case

Training computes on-hand as the warehouse count. Scoring computes on-hand as the webshop's copy. The model "drifts" every Monday because the inputs are different facts. The fix is one feature definition, not a new algorithm. A feature store helps when many jobs need that definition. A written column name and source helps even without the product.

Failure example: the laptop that was production

Symptom: The endpoint returns scores. The registry has no version that matches the running digest. The only build log is a terminal on one laptop, which was reimaged.

Diagnosis: There is no pipeline record. The image was pushed by hand. The root cause is an unrepeatable build, not a bad metric.

Correction: Rebuild from the committed code and the curated path. Register the model. Deploy the new digest on purpose. Retire the untracked image.

Validation: A second person can point at the run and see the data path, the code revision, the metric, and the digest. The laptop is not in that list.

Guided practice: promote or hold

Scenario: Version 5's metric is 0.77. The floor is 0.80. The blank-SKU share today is 0.08. The cutoff is 0.05. The endpoint runs version 3. Figures are illustrative.

Hints:

Complete solution:

Do not promote version 5. The metric is below the floor. The blank-SKU share is above the cutoff, so page the data owner about today's file. That alert does not by itself roll the endpoint back, and it does not prove the model weights changed. The endpoint stays on version 3 until a version passes the floor and a person promotes it. Record the shares so the alert is recomputable.

Independent practice

Write the promotion rule for one model.

Acceptance criteria:

Common mistakes

  • The newest job overwrites the endpoint.
  • A drift product with no baseline, so every day looks "different."
  • Two definitions of on-hand quantity.
  • Calling a laptop push a deployment pipeline.

Quick check

  1. What must a promotion pipeline record?
  2. Does registering version 4 replace the endpoint?
  3. What is a feature in this lesson?
  4. Who chooses the blank-SKU cutoff?
  5. What does a drift alert prove by itself?

Answers:

  1. The data path, the code revision, the metric, and the image digest or model version.
  2. No. Promotion is a separate step.
  3. A named input, with one definition for training and scoring.
  4. Northline, or your team. It is not an Azure default in this lesson.
  5. That the measured input share crossed a cutoff you set. It does not by itself change the endpoint.

Quiz alignment

The quiz asks you to record a build, to hold promotion, and to treat drift as a comparison against a cutoff you wrote down.

Lesson summary

Automate the build so a second person can see the inputs and the digest. Register models. Promote on purpose. Watch inputs with a measure and a cutoff. A feature must mean the same thing when you train and when you score.

Bridge to the next lesson

The next lesson calls prebuilt AI tools and Copilot without putting a key in a prompt, and without letting a draft write the ERP.