Build and run container web apps on Azure
A practical, step-by-step guide to packaging an ASP.NET Core web app as a container image and running it on Azure. Every step includes copy-ready Azure CLI and Docker commands.
What you will do
- Install the tools and sign in to Azure.
- Pick the right Azure hosting service for your container.
- Write a Dockerfile and build/test the image locally.
- Push the image to Azure Container Registry (ACR).
- Deploy it to App Service or Azure Container Apps.
- Automate builds and deployments with GitHub Actions.
- Troubleshoot common problems and clean up to avoid charges.
STEP 1
Prerequisites
Tools, subscription and sign-in.
STEP 2Choose a service
App Service vs Container Apps vs others.
STEP 3Build the image
Dockerfile, build and run locally.
STEP 4Push to a registry
Create ACR and publish your image.
STEP 5aApp Service
Simple, always-on web hosting.
STEP 5bContainer Apps
Serverless containers with autoscale.
STEP 6CI/CD
GitHub Actions pipeline.
STEP 7Troubleshooting
Logs, common errors, cleanup.
Tip: This very website is a containerized ASP.NET Core app. The solution includes
a working
Dockerfile, so you can use it as your practice app while following the guide.