Skip to content

Commit aa82486

Browse files
Merge pull request #571 from microsoft/dev
docs: Dev to main
2 parents db5227a + 46dd3ea commit aa82486

File tree

4 files changed

+335
-28
lines changed

4 files changed

+335
-28
lines changed

docs/ACRBuildAndPushGuide.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Azure Container Registry (ACR) – Build & Push Guide
2+
3+
This guide provides step-by-step instructions to build and push Docker images for **WebApp** and **Backend** services into Azure Container Registry (ACR).
4+
5+
## 📋 Prerequisites
6+
Before starting, ensure you have:
7+
- An active [Azure Subscription](https://portal.azure.com/)
8+
- [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli) installed and logged in
9+
- [Docker Desktop](https://docs.docker.com/get-docker/) installed and running
10+
- Access to your Azure Container Registry (ACR)
11+
- To create an Azure Container Registry (ACR), you can refer to the following guides:
12+
13+
- [Create Container Registry using Azure CLI](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-azure-cli)
14+
15+
- [Create Container Registry using Azure Portal](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal?tabs=azure-cli)
16+
17+
- [Create Container Registry using PowerShell](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-powershell)
18+
19+
- [Create Container Registry using ARM Template](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-geo-replication-template)
20+
21+
- [Create Container Registry using Bicep](https://learn.microsoft.com/en-us/azure/container-registry/container-registry-get-started-bicep?tabs=CLI)
22+
23+
---
24+
25+
Login to ACR :
26+
``` bash
27+
az acr login --name $ACR_NAME
28+
```
29+
30+
## 🚀 Build and Push Images
31+
32+
**Backend** / **WebApp :**
33+
34+
```bash
35+
az acr login --name <containerregname>
36+
docker build --no-cache -f WebApp.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
37+
docker push <acrloginserver>/<repo>:<tagname>
38+
```
39+
40+
If you want to update image tag and image manually you can follow below steps:
41+
- Go to your App Service in the [Azure Portal](https://portal.azure.com/#home).
42+
- In the left menu, select Deployment → Deployment Center
43+
- Under Registry settings, you can configure:
44+
45+
- Image Source → (e.g., Azure Container Registry / Docker Hub / Other).
46+
47+
- Image Name → e.g., myapp/backend.
48+
49+
- Tag → e.g., v1.2.3.
50+
51+
![alt text](./images/AppServiceContainer.png)
52+
53+
## ✅ Verification
54+
55+
Run the following command to verify that images were pushed successfully:
56+
```bash
57+
az acr repository list --name $ACR_NAME --output table
58+
```
59+
60+
You should see repositories in the output.
61+
62+
## 📝 Notes
63+
64+
- Always use meaningful tags (v1.0.0, staging, prod) instead of just latest.
65+
66+
- If you are pushing from a CI/CD pipeline, make sure the pipeline agent has access to Docker and ACR.
67+
68+
- For private images, ensure your services (e.g., Azure Container Apps, AKS, App Service) are configured with appropriate ACR pull permissions.
69+
70+
71+

0 commit comments

Comments
 (0)