|
| 1 | +# Guide: Migrating Azure Web App Service to a New Container Registry |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +### Current Problem: |
| 6 | +- The **CWYD Container Image** is being published in the **External ACR** (Azure Container Registry). |
| 7 | + |
| 8 | +### Goal: |
| 9 | +- The goal is to **migrate container images** from various applications to a common **CSA CTO Production Azure Container Registry**, ensuring all the different images are consolidated in one centralized location. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## Step-by-Step Guide: Migrating Azure Web App Service to a New Container Registry |
| 14 | + |
| 15 | +This guide will help you seamlessly switch the container registry for your **Azure Web App Service** from Azure Container Registry (ACR) to the new registry **`cwydcontainerreg`**. |
| 16 | + |
| 17 | +Follow the steps below to ensure a smooth migration. |
| 18 | + |
| 19 | +### Prerequisites: |
| 20 | +Before you begin, ensure you have the following: |
| 21 | +- Access to the **Azure Portal**. |
| 22 | +- The **container image** in the new registry is ready and accessible. |
| 23 | + |
| 24 | +--- |
| 25 | + |
| 26 | +### Step 1: Obtain Details for the New Registry |
| 27 | + |
| 28 | +Before you begin, ensure you have the following information: |
| 29 | +- **Registry URL**: The URL of the new registry (`https://cwydcontainerreg.azurecr.io`). |
| 30 | +- **Image Name and Tag**: The full name and tag of the image you want to use: |
| 31 | + - **Web App Image**: `rag-webapp:latest` |
| 32 | + - **Admin Web App Image**: `rag-adminwebapp:latest` |
| 33 | + - **Function App Image**: `rag-backend:latest` |
| 34 | + |
| 35 | +--- |
| 36 | + |
| 37 | +### Step 2: Update Azure Web App Service Configuration Using Azure Portal |
| 38 | + |
| 39 | +1. **Log in to Azure Portal**: |
| 40 | + - Open [Azure Portal](https://portal.azure.com/). |
| 41 | + |
| 42 | +2. **Locate Your Resource Group and Web App Service**: |
| 43 | + - Navigate to resource group which you have created for CWYD. |
| 44 | + - Navigate to **Web App Service**: From the list of resources, find and select **App Service** |
| 45 | + |
| 46 | +3. **Go to the Deployment Center**: |
| 47 | + - In the left-hand menu, click on **Deployment**. |
| 48 | + |
| 49 | +  |
| 50 | + |
| 51 | + |
| 52 | +4. **Update Image Source**: |
| 53 | + - Change the **Registry Source** to **Private**. |
| 54 | + - Set the **Server URL** to the new container registry (`https://cwydcontainerreg.azurecr.io`), as shown in the screenshot below. |
| 55 | + - Set the **Full Image name** to the relevant image name and tag: |
| 56 | + - For Web App: `rag-webapp:latest` |
| 57 | + |
| 58 | +  |
| 59 | + |
| 60 | +5. **Save Changes**: |
| 61 | + - Click **Save** to save the configuration. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +### Step 3: Restart the Web App Service |
| 66 | + |
| 67 | +After updating the configuration, restart your **Web App Service** to apply the changes: |
| 68 | + |
| 69 | +1. In the **Web App Service overview page**, click on **Restart**. |
| 70 | +2. Confirm the restart operation. |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +### Step 4: Update Azure Admin Web App Service Configuration Using Azure Portal |
| 75 | + |
| 76 | +1. **Locate Your Resource Group and Admin Web App Service**: |
| 77 | + - Navigate to resource group which you have created for CWYD. |
| 78 | + - Navigate to **Admin App Service**: From the list of resources, find and select **App Service** that contains `admin` in its name |
| 79 | + |
| 80 | +2. **Go to the Deployment Center**: |
| 81 | + - In the left-hand menu, click on **Deployment**. |
| 82 | + |
| 83 | +3. **Update Image Source for Admin Web App**: |
| 84 | + - Change the **Registry Source** to **Private**. |
| 85 | + - Set the **Server URL** to the new container registry (`https://cwydcontainerreg.azurecr.io`). |
| 86 | + - Set the **Full Image name** to the relevant image name and tag: |
| 87 | + - For **Admin Web App**: `rag-adminwebapp:latest` |
| 88 | + |
| 89 | +4. **Save Changes**: |
| 90 | + - Click **Save** to save the configuration. |
| 91 | + |
| 92 | +--- |
| 93 | + |
| 94 | +### Step 5: Restart the Admin Web App Service |
| 95 | + |
| 96 | +After updating the configuration, restart your **Admin Web App Service** to apply the changes: |
| 97 | + |
| 98 | +1. In the **Admin Web App Service overview page**, click on **Restart**. |
| 99 | +2. Confirm the restart operation. |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +### Step 6: Update Azure Function App Service Configuration Using Azure Portal |
| 104 | + |
| 105 | +1. **Locate Your Resource Group and Function App Service**: |
| 106 | + - Navigate to resource group which you have created for CWYD. |
| 107 | + - Navigate to **Function App**: From the list of resources, find and select **Function App** |
| 108 | + |
| 109 | +2. **Go to the Deployment Center**: |
| 110 | + - In the left-hand menu, click on **Deployment**. |
| 111 | + |
| 112 | +3. **Update Image Source for Function App**: |
| 113 | + - Change the **Registry Source** to **Private**. |
| 114 | + - Set the **Server URL** to the new container registry (`https://cwydcontainerreg.azurecr.io`). |
| 115 | + - Set the **Full Image name** to the relevant image name and tag: |
| 116 | + - For **Function App**: `rag-backend:latest` |
| 117 | + |
| 118 | +4. **Save Changes**: |
| 119 | + - Click **Save** to save the configuration. |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +### Step 7: Restart the Function App Service |
| 124 | + |
| 125 | +After updating the configuration, restart your **Function App Service** to apply the changes: |
| 126 | + |
| 127 | +1. In the **Function App Service overview page**, click on **Restart**. |
| 128 | +2. Confirm the restart operation. |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +### Step 8: Validate the Deployment |
| 133 | + |
| 134 | +1. **Access Your Web App**: |
| 135 | + - Open the **Web App URL** in a browser to ensure it’s running correctly. |
| 136 | + |
| 137 | +2. **Access Your Admin Web App**: |
| 138 | + - Open the **Admin Web App URL** in a browser to ensure it’s running correctly. |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +By following these steps, your **Azure Web App Service** will now use the new container from the **CWYD registry**. |
| 143 | + |
| 144 | +For further assistance, feel free to reach out to your support team or log an issue on GitHub. |
| 145 | + |
| 146 | +--- |
0 commit comments