Containers and AI Deployment
Lesson opener
In one line: A container image is a packed application. A container is a running copy. latest is not a version you can roll back to.
Why it matters: Northline's scoring API worked on one laptop. The cluster pull uses the tag latest. Tuesday's image fails health checks, and nobody can name the Friday image that worked. Figures are illustrative.
Before this lesson: You know a model is not deployed until an endpoint or another serving step exists.
What you will be able to do
- Separate an image, a container, and a registry.
- Refuse a floating tag for a production pull.
- Say what Azure Kubernetes Service operates, and when not to use it.
- Keep the scoring API from writing the system of record.
Prerequisites
Lessons 1 and 7. You will not install Docker in the practice. The setup guide's Docker lesson is optional if you want the desktop later.
Image, registry, cluster
A container image is the packed filesystem and the start command. A container is a running instance of an image (https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-a-container/). Build an image once. Run it many times.
Azure Container Registry stores those images for Azure (https://learn.microsoft.com/en-us/azure/container-registry/container-registry-intro). A production pull should name an immutable digest, or a tag you never move, so a rollback has a target. Moving latest means the next pull is a different application with the same name.
Azure Kubernetes Service (AKS) runs containers with Kubernetes, and Microsoft operates the control plane (https://learn.microsoft.com/en-us/azure/aks/what-is-aks). You still define pods, services, and how many copies run. AKS is the choice when you need that cluster model.
Azure Container Apps runs containers without you operating a Kubernetes cluster (https://learn.microsoft.com/en-us/azure/container-apps/overview). A single scoring API with modest scale can live there, or on the Azure Machine Learning online endpoint from lesson 7. Do not stand up AKS because a diagram said "containers."
The scoring API reads features and returns a score. It does not post a new on-hand quantity to the ERP. That write remains a separate, approved integration.
def production_ref(tag, digest):
if digest:
return "digest"
if tag and tag != "latest":
return "pinned-tag"
return "reject"
assert production_ref("latest", None) == "reject"
assert production_ref("2026-09-30.3", None) == "pinned-tag"
assert production_ref("latest", "sha256:abc") == "digest"Teacher walkthrough: score FX-100, do not restock it
All figures are illustrative.
- The image contains the scoring service and model version 3 from the workspace. The tag is
2026-09-30.3, and the registry lists a digest. - The team runs it on Container Apps because they have one API and no need to operate Kubernetes.
- A test request with SKU FX-100 returns a score. The ERP on-hand quantity is not in the response as a new value to write.
- Validation: the running revision's image digest matches the digest you tested. A request does not change the warehouse screen.
A second workplace case
Three services must roll together, with a private network and a scale rule the team already runs on Kubernetes. That is an AKS conversation. The single scoring API does not become an AKS requirement because it shares a slide with those services.
Failure example: latest moved
Symptom: Monday's health check fails. Friday's demonstration worked. The deployment manifest says scoring:latest.
Diagnosis: Someone pushed a new image onto latest. The cluster pulled it. There is no immutable name in the manifest, so rollback has no target. The root cause is the tag, not "containers are unstable."
Correction: Redeploy the digest you tested on Friday. Change the manifest so production cannot pull latest. Keep latest off the production service.
Validation: The running image digest equals Friday's digest. The health check passes. A new push to latest does not change the running revision.
Guided practice: pick a home for the API
Scenario: One scoring API, one team, no existing Kubernetes cluster. They also have a separate ERP write that a person must approve. Figures are illustrative.
Hints:
- Does this API need AKS?
- What may the image tag be?
- What must the API not do to on-hand quantity?
Complete solution:
Run the scoring API on Container Apps or on an Azure Machine Learning online endpoint. Do not create AKS for this API alone. The production reference is a digest or a tag you do not move, never latest. The API returns a score. The ERP write stays on the approved integration from the API course, with a person where that course required one. Validation is a test SKU plus an unchanged warehouse quantity.
Independent practice
Choose a runtime for one service you might ship.
Acceptance criteria:
- You say image versus container in one sentence each.
- You name the registry and the production reference, and you reject
latest. - You choose AKS, Container Apps, or an Azure Machine Learning endpoint, and you say why.
- You name one write the container must not perform.
- You name the digest check that proves the running copy.
Common mistakes
- AKS as the default because the word "enterprise" appeared.
latestin the production manifest.- Baking the ERP password into the image. The image is not a secret store.
- Letting the scoring service post stock adjustments.
Quick check
- What is the difference between an image and a container?
- Why is
latesta poor production reference? - What does AKS operate for you, and what do you still define?
- When is Container Apps a better fit than AKS in this lesson?
- May the scoring API change on-hand quantity?
Answers:
- The image is the packed application. The container is a running instance.
- The tag can move. The next pull may be a different build with the same name.
- Microsoft operates the Kubernetes control plane. You define the workloads and how they scale.
- When you have a container to run and you do not need to operate a cluster.
- No. It returns a score. The warehouse system remains the system of record.
Quiz alignment
The quiz asks you to pin an image, to choose AKS only when you need a cluster, and to keep the scoring service from writing stock.
Lesson summary
Build an image, store it in a registry, and run a named digest. AKS is for Kubernetes workloads. A single scoring API can live on a simpler container host or on an Azure Machine Learning endpoint. The container does not become the system of record.
Bridge to the next lesson
The next lesson promotes that image and that model with automation: a pipeline, a registry, a monitor, and a drift check that uses a threshold you wrote down.