The first time someone explained Docker to me, they said: "It is like shipping your laptop to production, but only the parts that matter." I laughed, but it stuck with me.
Our Todo API currently runs on App Service with the .NET runtime that Azure provides. That works great. But sometimes you want full control over exactly what runs: the OS packages, the .NET version, everything. That is where containers come in.
In Part 6 we sorted out configuration and secrets. Today we:
Write a Dockerfile for the Todo API
Build the image in Azure Pipelines
Push it to Azure Container Registry (ACR)
Run the container on App Service
What you need to know before the code
A Dockerfile is a recipe. Docker follows it and produces an image : your app plus everything it needs to run.
A registry (we use Azure Container Registry) is a private storage place for images, like a private Docker Hub.
App Service can pull an image from the registry and run it .…