Skip to content

Commit fec8786

Browse files
Merge pull request #992 from microsoft/pk-km-ownCRImage
feat: Updated the infra for ACR and script for builing iamges
2 parents 3a19f97 + e76c248 commit fec8786

17 files changed

Lines changed: 3699 additions & 209 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ either by deleting the resource group in the Portal or running `azd down`.
113113
| [Microsoft Foundry](https://learn.microsoft.com/en-us/azure/ai-foundry) | Used to orchestrate and build AI workflows that combine Azure AI services. | Free Tier | [Pricing](https://azure.microsoft.com/pricing/details/ai-studio/) |
114114
| [Foundry IQ](https://learn.microsoft.com/en-us/azure/search/search-what-is-azure-search) | Powers vector-based semantic search for retrieving indexed conversation data. | Standard S1; costs scale with document count and replica/partition settings. | [Pricing](https://azure.microsoft.com/pricing/details/search/) |
115115
| [Azure Storage Account](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview) | Stores transcripts, intermediate outputs, and application assets. | Standard LRS; usage-based cost by storage/operations. | [Pricing](https://azure.microsoft.com/pricing/details/storage/blobs/) |
116-
| [Azure AI Services (OpenAI)](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/overview) | Enables language understanding, summarization, entity extraction, and chat capabilities using GPT models. | S0 Tier; pricing depends on token volume and model used (e.g., GPT-4o-mini). | [Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/) |
116+
| [Azure AI Services (OpenAI)](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/overview) | Enables language understanding, summarization, entity extraction, and chat capabilities using GPT models. | S0 Tier; pricing depends on token volume and model used (e.g., GPT-5.2). | [Pricing](https://azure.microsoft.com/pricing/details/cognitive-services/) |
117117
| [Azure App Service](https://learn.microsoft.com/en-us/azure/app-service/overview) | Hosts the front-end web application and backend API as Linux web apps. | Basic B3 (non-WAF) or Premium P1v3 (WAF); fixed cost based on plan tier. | [Pricing](https://azure.microsoft.com/pricing/details/app-service/linux/) |
118118
| [Azure Monitor / Log Analytics](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-overview) | Collects and analyzes telemetry and logs from services and containers. | Pay-as-you-go; charges based on data ingestion volume. | [Pricing](https://azure.microsoft.com/pricing/details/monitor/) |
119119
| [Azure SQL Database](https://learn.microsoft.com/en-us/azure/azure-sql/database/sql-database-paas-overview) | Stores structured data including insights, metadata, and indexed results. | General Purpose Tier; can be provisioned or serverless. Fixed cost if provisioned. | [Pricing](https://azure.microsoft.com/pricing/details/azure-sql-database/single/) |

azure.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ hooks:
1919
Write-Host "Web app URL: "
2020
Write-Host "$env:WEB_APP_URL" -ForegroundColor Cyan
2121
22+
Write-Host "`nRun the following command in your Bash terminal to build the backend and frontend container images, push them to the provisioned Azure Container Registry, and update the App Services to use them:"
23+
Write-Host "bash ./infra/scripts/build_and_push_images.sh" -ForegroundColor Cyan
24+
2225
Write-Host "`nCreate and activate a virtual environment if not already done, then run the following command in the bash terminal to create agents:"
2326
Write-Host "bash ./infra/scripts/run_create_agents_scripts.sh" -ForegroundColor Cyan
2427
Write-Host "`nRun the following command in your Bash terminal. It will grant the necessary permissions between resources and your user account, and also process and load the sample data into the application."
@@ -31,6 +34,9 @@ hooks:
3134
echo "Web app URL: "
3235
echo $WEB_APP_URL
3336
37+
echo "\nRun the following command in your Bash terminal to build the backend and frontend container images, push them to the provisioned Azure Container Registry, and update the App Services to use them:"
38+
echo "bash ./infra/scripts/build_and_push_images.sh"
39+
3440
echo "\nCreate and activate a virtual environment if not already done, then run the following command in the bash terminal to create agents:"
3541
echo "bash ./infra/scripts/run_create_agents_scripts.sh"
3642
echo ""

documents/AzureGPTQuotaSettings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
3. **Go to** the `Management Center` from the bottom-left navigation menu.
66
4. Select `Quota`
77
- Click on the `GlobalStandard` dropdown.
8-
- Select the required **GPT model** (`GPT-4, GPT-4o, GPT-4o Mini`) or **Embeddings model** (`text-embedding-3-small`).
8+
- Select the required **GPT model** (`gpt-5.2`) or **Embeddings model** (`text-embedding-3-small`).
99
- Choose the **region** where the deployment is hosted.
1010
5. Request More Quota or delete any unused model deployments as needed.

documents/CustomizingAzdParameters.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,19 @@ By default this template will use the environment name as the prefix to prevent
1212
| `AZURE_LOCATION` | string | ` ` | Sets the Azure region for resource deployment. |
1313
| `AZURE_ENV_NAME` | string | `env_name` | Sets the environment name prefix for all Azure resources. |
1414
| `AZURE_ENV_AI_SERVICE_LOCATION` | string | `eastus2` | Specifies the Azure AI service location. |
15-
| `AZURE_ENV_SECONDARY_LOCATION` | string | `eastus2` | Specifies a secondary Azure region. |
16-
| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). **Note:** The `azd` location-picker filters regions using the `usageName` metadata on `aiServiceLocation` in `infra/main.bicep` (currently `OpenAI.GlobalStandard.gpt-4o-mini,150`). If you set this to `Standard`, also edit that metadata to `OpenAI.Standard.gpt-4o-mini,150` so the picker shows the correct subset of regions, since `gpt-4o-mini` Standard (regional) availability differs from Global Standard. |
17-
| `AZURE_ENV_GPT_MODEL_NAME` | string | `gpt-4o-mini` | Specifies the GPT model name (e.g., `gpt-4o-mini`, `gpt-4.1`, etc.). |
18-
| `AZURE_ENV_GPT_MODEL_VERSION` | string | `2024-07-18` | Sets the Azure model version (e.g., `2024-07-18`, etc.). |
15+
| `AZURE_ENV_SECONDARY_LOCATION` | string | `australiaeast` | Specifies a secondary Azure region. |
16+
| `AZURE_ENV_MODEL_DEPLOYMENT_TYPE` | string | `GlobalStandard` | Defines the model deployment type (allowed: `Standard`, `GlobalStandard`). **Note:** The `azd` location-picker filters regions using the `usageName` metadata on `aiServiceLocation` in `infra/main.bicep` (currently `OpenAI.GlobalStandard.gpt-5.2,150`). If you set this to `Standard`, also edit that metadata to `OpenAI.Standard.gpt-5.2,150` so the picker shows the correct subset of regions, since `gpt-5.2` Standard (regional) availability differs from Global Standard. |
17+
| `AZURE_ENV_GPT_MODEL_NAME` | string | `gpt-5.2` | Specifies the GPT model name (e.g., `gpt-5.2`, `gpt-4.1`, etc.). |
18+
| `AZURE_ENV_GPT_MODEL_VERSION` | string | `2025-12-11` | Sets the Azure model version (e.g., `2025-12-11`, etc.). |
1919
| `AZURE_ENV_GPT_MODEL_CAPACITY` | integer | `30` | Sets the GPT model capacity. |
2020
| `AZURE_ENV_EMBEDDING_MODEL_NAME` | string | `text-embedding-3-small` | Sets the name of the embedding model to use. |
21-
| `AZURE_ENV_IMAGE_TAG` | string | `latest_afv2` | Sets the image tag (`latest_afv2`, `dev`, `hotfix`, etc.). |
21+
| `AZURE_ENV_IMAGE_TAG` | string | `latest` | Sets the image tag (`latest`, `dev`, `hotfix`, etc.). |
2222
| `AZURE_ENV_EMBEDDING_DEPLOYMENT_CAPACITY` | integer | `80` | Sets the capacity for the embedding model deployment. |
2323
| `AZURE_ENV_EXISTING_LOG_ANALYTICS_WORKSPACE_RID` | string | Guide to get your [Existing Workspace ID](/documents/re-use-log-analytics.md) | Reuses an existing Log Analytics Workspace instead of creating a new one. |
24-
| `USE_LOCAL_BUILD` | string | `false` | Indicates whether to use a local container build for deployment. |
2524
| `AZURE_EXISTING_AIPROJECT_RESOURCE_ID` | string | `<Existing AI Project resource Id>` | Reuses an existing AIFoundry and AIFoundryProject instead of creating a new one. |
2625
| `AZURE_ENV_VM_ADMIN_USERNAME` | string | `take(newGuid(), 20)` | The administrator username for the virtual machine. |
2726
| `AZURE_ENV_VM_ADMIN_PASSWORD` | string | `newGuid()` | The administrator password for the virtual machine. |
2827
| `AZURE_ENV_VM_SIZE` | string | `Standard_D2s_v5` | The size/SKU of the Jumpbox Virtual Machine (e.g., `Standard_D2s_v5`, `Standard_DS2_v2`). |
29-
| `AZURE_ENV_CONTAINER_REGISTRY_ENDPOINT` | string | `<Container Registry Endpoint>` | The hostname/endpoint for the container registry used by both backend and frontend containers. |
3028

3129

3230
## How to Set a Parameter

documents/DeploymentGuide.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ azd up
289289
**During deployment, you'll be prompted for:**
290290
1. **Environment name** (e.g., "ckmapp") - Must be 3-16 characters long, alphanumeric only
291291
2. **Azure subscription** selection
292-
3. **Microsoft Foundry deployment region** - Select a region with available gpt-4o model quota for AI operations
292+
3. **Microsoft Foundry deployment region** - Select a region with available gpt-5.2 model quota for AI operations
293293
4. **Primary location** - Select the region where your infrastructure resources will be deployed
294294
5. **Resource group** selection (create new or use existing)
295295
6. **Use case** selection:
@@ -312,9 +312,39 @@ After successful deployment:
312312
4. Click on the App Service to open its overview page
313313
5. Copy the **Default domain** URL (e.g., `app-abc123def.azurewebsites.net`)
314314
315-
⚠️ **Important:** Complete the following steps to process sample data and configure authentication before accessing the application.
315+
⚠️ **Important:** Complete the following steps to build the application container images, process sample data, and configure authentication before accessing the application.
316316
317-
### 4.4 Process Sample Data
317+
### 4.4 Build and Push Container Images
318+
319+
This solution provisions a dedicated **Azure Container Registry (ACR)** in your resource group. During provisioning, the backend and frontend App Services start with a temporary *hello-world* placeholder image. Run the following script to build the backend (`km-api`) and frontend (`km-app`) images, push them to your ACR, and update the App Services to run them.
320+
321+
**Run the build and push script:**
322+
323+
The `azd up` deployment output includes a ready-to-use bash script command. Look for the script in the deployment output and run it:
324+
325+
```bash
326+
bash ./infra/scripts/build_and_push_images.sh
327+
```
328+
329+
The images are **built remotely in ACR** using `az acr build`, so no local Docker installation is required.
330+
331+
**If you don't have `azd env` configured**, pass the resource group name so the script can resolve values from the deployment outputs:
332+
333+
```bash
334+
bash ./infra/scripts/build_and_push_images.sh <resource-group>
335+
```
336+
337+
**What the script does:**
338+
- Builds the backend image from [src/api/ApiApp.Dockerfile](../src/api/ApiApp.Dockerfile)
339+
- Builds the frontend image from [src/App/WebApp.Dockerfile](../src/App/WebApp.Dockerfile)
340+
- Pushes both images to the provisioned Azure Container Registry
341+
- Updates the backend and frontend App Services to run the new images (pulled via managed identity) and restarts them
342+
343+
> **Note:** For Production (WAF) deployments, ACR public network access is disabled. The script temporarily enables it to build/push the images and restores the original setting when it finishes.
344+
345+
**Expected Processing Time:** 5-10 minutes depending on network speed.
346+
347+
### 4.5 Process Sample Data
318348

319349
After the infrastructure deployment completes, follow these steps to process and load the sample data:
320350

documents/QuotaCheck.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ az login --use-device-code
1414

1515
### 📌 Default Models & Capacities:
1616
```
17-
gpt-4o:150, gpt-4o-mini:150, gpt-4:150, text-embedding-3-small:80
17+
gpt-5.2:150, text-embedding-3-small:80
1818
```
1919
### 📌 Default Regions:
2020
```
@@ -40,19 +40,19 @@ eastus, eastus2, australiaeast, uksouth, swedencentral, westus, westus3, japanea
4040
```
4141
✔️ Check specific model(s) in default regions:
4242
```
43-
./quota_check_params.sh --models gpt-4o:150,text-embedding-3-small:80
43+
./quota_check_params.sh --models gpt-5.2:150,text-embedding-3-small:80
4444
```
4545
✔️ Check default models in specific region(s):
4646
```
4747
./quota_check_params.sh --regions eastus,westus
4848
```
4949
✔️ Passing Both models and regions:
5050
```
51-
./quota_check_params.sh --models gpt-4o:150 --regions eastus,westus2
51+
./quota_check_params.sh --models gpt-5.2:150 --regions eastus,westus2
5252
```
5353
✔️ All parameters combined:
5454
```
55-
./quota_check_params.sh --models gpt-4:150,text-embedding-3-small:80 --regions eastus,westus --verbose
55+
./quota_check_params.sh --models gpt-5.2:150,text-embedding-3-small:80 --regions eastus,westus --verbose
5656
```
5757

5858
### **Sample Output**

documents/re-use-foundry-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ To configure your environment to use an existing Microsoft Foundry Project, foll
55

66
> **⚠️ Region requirement**
77
>
8-
> The existing Foundry project must reside in a region that supports **both** the GPT model deployed by this accelerator (default `gpt-4o-mini` with `GlobalStandard` deployment type) **and** Azure AI Content Understanding (GA).<br>
8+
> The existing Foundry project must reside in a region that supports **both** the GPT model deployed by this accelerator (default `gpt-5.2` with `GlobalStandard` deployment type) **and** Azure AI Content Understanding (GA).<br>
99
> Supported regions: `australiaeast`, `eastus`, `eastus2`, `japaneast`, `southcentralus`, `swedencentral`, `uksouth`, `westeurope`, `westus`, `westus3`.<br>
1010
> If the existing project is in a different region, deployment will fail or the application will not work correctly.
1111

0 commit comments

Comments
 (0)