In this post, we will see how to deploy a Docker container on Azure using Azure Container Apps.
The goal of this post is very simple: we will create a basic HTML page, we will put it inside a Docker image using Nginx, we will push the image into Azure Container Registry, and finally we will deploy it using Azure Container Apps.
We will use Visual Studio Code to create the files, Docker Desktop to build and push the image, and the Azure Portal to create the Azure resources.
At the end of the post, we will have a public URL where we can open our HTML page running inside a container on Azure.
What is Azure Container Apps?
Azure Container Apps is an Azure service that allows us to run containerized applications without managing servers, virtual machines, or Kubernetes clusters directly.
With Azure Container Apps, we can deploy a container image, expose it through HTTP, configure environment variables, scale the application, and manage revisions.
In other words, we can focus on the container and on the application, while Azure manages the underlying infrastructure for us.
This is useful when we want to deploy small services, APIs, background workers, microservices, or simple web applications without the complexity of managing a full Kubernetes cluster.
What is Azure Container Registry?
Before deploying a container, we need a place where the container image can be stored.
This is where Azure Container Registry comes in.
Azure Container Registry, usually called ACR, is a private Docker registry hosted in Azure. It allows us to store, manage, and distribute container images.
When we create a Docker image on our machine, the image exists only locally.
Azure Container Apps cannot use an image that is only available on our computer.
Azure needs to pull the image from a registry.
STEP 1: CREATE THE HTML PAGE
First we create a simple HTML page called index.html, that will be served by Nginx inside the container.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zone of Development - Azure Demo</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
color: #333;
text-align: center;
padding: 50px;
}
.container {
background: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
display: inline-block;
}
h1 { color: #0078d4; }
</style>
</head>
<body>
<div class="container">
<h1>Hello from Azure Containers!</h1>
<p>This container was successfully deployed via the Azure Portal.</p>
<p><strong>Status:</strong> Online & Working</p>
</div>
</body>
</html>
STEP 2: CREATE THE DOCKERFILE
Now, we create the Dockerfile that will be used to build the Docker image.
We will use the official Nginx image and copy our HTML page into the default Nginx folder.
Create a file named Dockerfile and add the following content:
FROM nginx:alpine
COPY index.html /usr/share/nginx/html
EXPOSE 80
STEP 3: BUILD AND TEST THE DOCKER IMAGE
Before deploying the image to Azure, we should verify that it works correctly on our local machine.
We start by building the image using the following command:
docker build --platform linux/amd64 -t html-demo:v1 .

Once the image has been created, we can run the container locally:
docker run -d -p 8080:80 html-demo:v1
Now we open the following URL in our browser: https://localhost:8080
If everything is working correctly, we should see this page:

STEP 4: CREATE AN AZURE CONTAINER REGISTRY
Before deploying the container, we need to create the Azure resources that will host and store our application.
In this example, we will create a Resource Group and an Azure Container Registry.
[Create the Resource Group]
From Azure Portal, we will create a Resource Group called rg-container-demo
[Create the Azure Container Registry]
Now that the Resource Group has been created, we can create the Azure Container Registry (ACR).
This service will store our Docker images and make them available to Azure Container Apps.
From the Azure Portal, navigate to: Container Registries => Create:

We will configure the registry using these values:
Subscription: our Azure Subscription
Resource Group: rg-container-demo
Registry Name: mycontainerregistrydemo
SKU: Basic
Once the registry has been created, open it and navigate to: Settings => Acces Keys and we enable the Admin option:

After enabling it, we have copy the Username and Password because they will be required in the next step
[STEP 5: PUSH THE IMAGE TO AZURE CONTAINER REGISTRY]
Now that the registry is available, we can upload the Docker image.
First, we log in to Azure Container Registry using the login server copied from the Azure Portal:
docker login mycontainerregistrydemo.azurecr.io

After the login is completed successfully, we tag the image with the registry name:
docker tag html-demo:v1 mycontainerregistrydemo.azurecr.io/html-demo:v1
Finally, we push the image to Azure:
docker push mycontainerregistrydemo.azurecr.io/html-demo:v1

Once the upload is completed, the image will be available inside Azure Container Registry and can be used by Azure Container Apps.
[STEP 6: CREATE AN AZURE CONTAINER APP]
With the image stored in Azure Container Registry, we can create the Azure Container App that will run the container.
We open the Azure Portal and navigate to: Container app => Create

We configure the basic settings:
Resource Group: rg-container-demo
Container App Name: html-container-demo

Then, we configure the container image:
Image Source: Azure Container Registry
Registry: mycontainerregistrydemo
Image: html-demo
Tag: v1

Finally, for making the application accessible from the browser, we need to enable Ingress.
We configure the following settings:
Ingress: Enabled
Ingress Type: HTTP
Target Port: 80
Traffic: Accept from anywhere

Azure will start creating the Container App and deploy the image.

[STEP 8: VERIFY THE DEPLOYMENT]
Once the deployment is completed, Azure generates a public URL for the application.
We open the Container App and navigate to: Container App => Overview => Application URL
Then we click the genereted URL:

