Skip to content

Commit f01dc1b

Browse files
Merge pull request #605 from microsoft/dev
docs: Updated the troubleshooting guide and ACRBuildAndPushGuide
2 parents fc03db4 + 6bf8cac commit f01dc1b

File tree

4 files changed

+358
-29
lines changed

4 files changed

+358
-29
lines changed

documents/ACRBuildAndPushGuide.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
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 :**
33+
34+
```bash
35+
az acr login --name <containerregname>
36+
docker build --no-cache -f api/ApiApp.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 api 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+
**WebApp :**
54+
55+
```bash
56+
az acr login --name <containerregname>
57+
docker build --no-cache -f App/WebApp.Dockerfile -t <acrloginserver>/<repo>:<tagname> .
58+
docker push <acrloginserver>/<repo>:<tagname>
59+
```
60+
61+
If you want to update image tag and image manually you can follow below steps:
62+
- Go to your App Service in the [Azure Portal](https://portal.azure.com/#home).
63+
- In the left menu, select Deployment → Deployment Center
64+
- Under Registry settings, you can configure:
65+
66+
- Image Source → (e.g., Azure Container Registry / Docker Hub / Other).
67+
68+
- Image Name → e.g., myapp/backend.
69+
70+
- Tag → e.g., v1.2.3.
71+
72+
![alt text](./Images/AppServiceContainer.png)
73+
74+
75+
## ✅ Verification
76+
77+
Run the following command to verify that images were pushed successfully:
78+
```bash
79+
az acr repository list --name $ACR_NAME --output table
80+
```
81+
82+
You should see repositories in the output.
83+
84+
## 📝 Notes
85+
86+
- Always use meaningful tags (v1.0.0, staging, prod) instead of just latest.
87+
88+
- If you are pushing from a CI/CD pipeline, make sure the pipeline agent has access to Docker and ACR.
89+
90+
- For private images, ensure your services (e.g., Azure Container Apps, AKS, App Service) are configured with appropriate ACR pull permissions.
91+
92+
93+
121 KB
Loading

documents/Images/ContainerApp.png

94.6 KB
Loading

0 commit comments

Comments
 (0)