Managing the Model Lifecycle
This lesson explains how lifecycle stages are recorded, how models are promoted between environments, and how archiving and lineage support audits.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the stage property and tags.
- Explain promotion through a registry.
- Distinguish archiving from deleting.
- Describe how lineage supports audits.
Lifecycle stages
Most organizations recognize a sequence of stages for a model version: candidate (registered by a training run), validated (passed evaluation and responsible AI review), staging (deployed to a test endpoint), production (serving traffic), and retired (replaced and no longer served). Several versions of one model are usually alive at once: one in production, one in staging and several candidates.
Azure Machine Learning does not impose fixed stage names. A model version has an optional free-text stage property, set with az ml model update --stage and filtered with az ml model list --stage, and stage is also recorded through tags and through where the model is: in a development workspace, in a registry, or deployed to a production endpoint. MLflow's own model stages were deprecated in MLflow in favour of aliases and tags, so tags are the portable choice.
Tags and descriptions
A model version's files and type are immutable, but its description, tags and stage can be changed. Tags record the facts a release process needs, such as evaluation results, approval and stage, and they can be searched.
az ml model update --name churn --version 7 \
--set tags.stage=production tags.approved_by=risk-office tags.scorecard=rai-2026-11-03.pdf \
-g rg-ml-prod -w mlw-churn-prod
az ml model list --name churn --query "[?tags.stage=='production'].version" -o tsvRelease workflows usually set tags automatically, for example writing the test metrics when a model is registered and the approver's name when a deployment is approved, so the registry becomes a reliable record rather than a manually maintained one.
Promotion between environments
A model should be promoted, not retrained, between environments: the bits that were validated are the bits that serve production. With separate workspaces per environment, promotion copies the model version into an Azure Machine Learning registry with az ml model share, and each environment deploys it from the registry.
Archiving and retirement
Model lists fill up with old candidates. az ml model archive archives one version, or every version of a model when no version is given. Archived versions are hidden from az ml model list and the studio by default but can still be referenced, so existing deployments and pipelines that use them keep working. az ml model restore makes them visible again. A new version created under an archived model name is also archived.
az ml model archive --name churn --version 3 -g rg-ml-dev -w mlw-churn-dev
az ml model list --name churn --archived-only -g rg-ml-dev -w mlw-churn-dev
az ml model restore --name churn --version 3 -g rg-ml-dev -w mlw-churn-devRetiring a production model means moving traffic to its successor, deleting its deployment, updating its tags, and archiving it. Deleting the model version is rarely appropriate, because it removes lineage that audits and incident reviews may need years later.
Lineage and audit
Lineage connects a model version to the job that produced it, and through the job to the code snapshot, Git commit, environment version and data asset versions. With tags for approvals and a registry for promotion, an auditor can follow a production prediction back to the training data and the person who approved the model.
- Register models from job outputs, never from local files, in production processes.
- Train from clean Git commits through workflows, so the commit recorded with the job is the code that ran.
- Use pinned data and environment versions so the inputs can be retrieved.
- Archive rather than delete, so the chain stays intact.
Tidying the registry safely
A workspace has 140 versions of a model, most of them failed or superseded candidates. Data scientists struggle to find current versions. Version 31 is in production and version 34 in staging. Compliance requires that the lineage of every model that ever served traffic be kept.
Archive the superseded versions, for example every version except 31, 34 and recent candidates, with az ml model archive. Archived versions disappear from default lists but remain referenceable and keep their lineage. Tag versions 31 and 34 with their stages so they are easy to find, and add an archiving step to the release workflow so the list stays tidy.
Deleting old versions would lose the lineage compliance requires. Renaming current versions is not possible, because names and versions are immutable. Moving all versions to a registry would copy the clutter rather than remove it.
What is the difference between archiving and deleting a model version?
Show answer
An archived version is hidden from lists but remains usable by existing references and keeps its lineage, and it can be restored. Deleting removes it, which breaks lineage for audits.
Exam Tips
Remember for the exam
- Record lifecycle state with the stage property and tags; files never change on a version.
- Promote validated versions through a registry instead of retraining.
- Archived models are hidden but usable; restore reverses archiving.
- Archive rather than delete to keep lineage for audits.