Skip to content

Latest commit

 

History

History
95 lines (60 loc) · 3.36 KB

File metadata and controls

95 lines (60 loc) · 3.36 KB

Azure Container Registry (ACR) – Build & Push Guide

This guide provides step-by-step instructions to build and push Docker images for WebApp and Backend services into Azure Container Registry (ACR).

📋 Prerequisites

Before starting, ensure you have:


Login to ACR :

az acr login --name $ACR_NAME

🚀 Build and Push Images

Backend :

az acr login --name <containerregname>
cd src/api
docker build --no-cache -f ApiApp.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
docker push <acrloginserver>/<repo>:<tagname>

If you want to update image tag and image manually you can follow below steps:

  • Go to your api App Service in the Azure Portal.

  • In the left menu, select Deployment → Deployment Center

  • Under Registry settings, you can configure:

    • Image Source → (e.g., Azure Container Registry / Docker Hub / Other).

    • Image Name → e.g., myapp/backend.

    • Tag → e.g., v1.2.3.

alt text

WebApp :

az acr login --name <containerregname>
cd src/App
docker build --no-cache -f WebApp.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
docker push <acrloginserver>/<repo>:<tagname>

If you want to update image tag and image manually you can follow below steps:

  • Go to your App Service in the Azure Portal.

  • In the left menu, select Deployment → Deployment Center

  • Under Registry settings, you can configure:

    • Image Source → (e.g., Azure Container Registry / Docker Hub / Other).

    • Image Name → e.g., myapp/backend.

    • Tag → e.g., v1.2.3.

alt text

✅ Verification

Run the following command to verify that images were pushed successfully:

az acr repository list --name $ACR_NAME --output table

You should see repositories in the output.

📝 Notes

  • Always use meaningful tags (v1.0.0, staging, prod) instead of just latest.

  • If you are pushing from a CI/CD pipeline, make sure the pipeline agent has access to Docker and ACR.

  • For private images, ensure your services (e.g., Azure Container Apps, AKS, App Service) are configured with appropriate ACR pull permissions.