Skip to content

Commit c892e62

Browse files
Merge pull request #325 from microsoft/main
fix: downmerge from main to dev
2 parents fd3a827 + c6b6251 commit c892e62

11 files changed

Lines changed: 583 additions & 1787 deletions

File tree

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal1-Microsoft @VinaySh-Microsoft @aniaroramsft @Dongbumlee @sethsteenken @toherman-msft @nchandhi @dgp10801
5+
* @Avijit-Microsoft @Roopan-Microsoft @Prajwal-Microsoft @Vinay-Microsoft @aniaroramsft @Dongbumlee @sethsteenken @toherman-msft @nchandhi @dgp10801

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ on:
1414
paths:
1515
- 'infra/**'
1616
- 'azure.yaml'
17-
- 'azure_custom.yaml'
1817
- 'scripts/**'
1918
- '.github/workflows/ci.yml'
2019
pull_request:
@@ -23,7 +22,6 @@ on:
2322
paths:
2423
- 'infra/**'
2524
- 'azure.yaml'
26-
- 'azure_custom.yaml'
2725
- 'scripts/**'
2826
- '.github/workflows/ci.yml'
2927
schedule:

azure.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ hooks:
3333
posix:
3434
shell: sh
3535
run: |
36-
echo "==> Building and pushing container images to the dedicated ACR (remote build)"
37-
bash ./scripts/deploy_container_images.sh
36+
echo "ℹ️ Container images are NOT built automatically. Run the build manually when ready:"
37+
echo " bash ./scripts/acr_build_push.sh"
3838
echo "-----"
3939
echo "🧭 Web App Details:"
4040
echo "✅ Name: $CONTAINER_WEB_APP_NAME"
@@ -50,8 +50,8 @@ hooks:
5050
windows:
5151
shell: pwsh
5252
run: |
53-
Write-Host "==> Building and pushing container images to the dedicated ACR (remote build)"
54-
./scripts/deploy_container_images.ps1
53+
Write-Host "ℹ️ Container images are NOT built automatically. Run the build manually when ready:"
54+
Write-Host " ./scripts/acr_build_push.ps1"
5555
Write-Host "-----"
5656
Write-Host "🧭 Web App Details:"
5757
Write-Host "✅ Name: $env:CONTAINER_WEB_APP_NAME"

azure_custom.yaml

Lines changed: 0 additions & 108 deletions
This file was deleted.

docs/DeploymentGuide.md

Lines changed: 17 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,21 @@ azd up
294294

295295
**⚠️ Deployment Issues:** If you encounter errors or timeouts, try a different region as there may be capacity constraints. For detailed error solutions, see our [Troubleshooting Guide](./TroubleShootingSteps.md).
296296

297-
### 4.3 Get Application URL
297+
### 4.3 Run the script to build and push the application images
298+
299+
Build and push the frontend, backend, and processor images to the dedicated ACR, then update the Container Apps to use them. This step is **not run automatically** by `azd up` — run it from the repository root after deployment:
300+
301+
```powershell
302+
# PowerShell
303+
./scripts/acr_build_push.ps1
304+
```
305+
306+
```bash
307+
# Bash
308+
bash ./scripts/acr_build_push.sh
309+
```
310+
311+
### 4.4 Get Application URL
298312

299313
After successful deployment:
300314
1. Open [Azure Portal](https://portal.azure.com/)
@@ -315,7 +329,7 @@ After successful deployment:
315329

316330
### 5.2 Verify Deployment
317331

318-
1. Access your application using the URL from Step 4.3
332+
1. Access your application using the URL from Step 4.4
319333
2. Confirm the application loads successfully
320334
3. Verify you can sign in with your authenticated account
321335

@@ -460,64 +474,4 @@ Now that your deployment is complete and tested, explore these resources to enha
460474
461475
- 🐛 **Issues:** Check [Troubleshooting Guide](./TroubleShootingSteps.md)
462476
- 💬 **Support:** Review [Support Guidelines](../SUPPORT.md)
463-
- 🔧 **Development:** See [Contributing Guide](../CONTRIBUTING.md)
464-
465-
---
466-
467-
## Advanced: Deploy Local Changes
468-
469-
If you've made local modifications to the code and want to deploy them to Azure, follow these steps to swap the configuration files so that `azd up` builds Docker images from your local source code instead of pulling pre-built images from the GitHub repository.
470-
471-
**How it works:**
472-
- The custom `azure.yaml` defines three services (backend, processor, frontend) with `remoteBuild: true`, which instructs `azd` to build Docker images from your local `src/` directories and push them to Azure Container Registry (ACR).
473-
- The custom `main.bicep` accepts image name parameters (`backendImageName`, `processorImageName`, `frontendImageName`) that `azd` passes automatically after building the images.
474-
475-
> **Note:** To set up and run the application locally for development, see the [Local Development Setup Guide](./LocalDevelopmentSetup.md).
476-
477-
### Step 1: Rename Azure Configuration Files
478-
479-
**In the root directory:**
480-
1. Rename `azure.yaml` to `azure_custom2.yaml`
481-
2. Rename `azure_custom.yaml` to `azure.yaml`
482-
483-
### Step 2: Rename Infrastructure Files
484-
485-
**In the `infra` directory:**
486-
1. Rename `main.bicep` to `main_custom2.bicep`
487-
2. Rename `main_custom.bicep` to `main.bicep`
488-
489-
### Step 3: Deploy Changes
490-
491-
> ⚠️ **Critical: Redeployment Warning**
492-
> If you have previously run `azd up` in this folder (i.e., a `.azure` folder exists), you must create a fresh environment before deploying to avoid conflicts and deployment failures.
493-
494-
**Create a fresh environment:**
495-
```shell
496-
# Create a new named environment (3-16 characters, alphanumeric only)
497-
azd env new <new-environment-name>
498-
```
499-
500-
> **Note:** When prompted "Set new environment as default environment?", select **Y**. This eliminates the need to run `azd env select` separately.
501-
502-
**Run the deployment:**
503-
```shell
504-
azd up
505-
```
506-
507-
> **Note:** During the packaging phase, you may see `"No artifacts were found"` for each service. This is expected — because `remoteBuild: true` is configured, Docker images are built remotely on Azure Container Registry, not on your local machine. Your local code is still being deployed.
508-
509-
**⚠️ Deployment Issues:** If `azd up` fails on the first attempt (e.g., with a `ResourceNotFound` error), try running `azd up` again. Transient errors can occur due to resource propagation delays, and a retry typically resolves them. For other errors, try a different region or see the [Troubleshooting Guide](./TroubleShootingSteps.md).
510-
511-
### Step 4: Revert Configuration Files
512-
513-
After your custom deployment is complete, revert the renames to restore the original configuration:
514-
515-
**In the root directory:**
516-
1. Rename `azure.yaml` to `azure_custom.yaml`
517-
2. Rename `azure_custom2.yaml` to `azure.yaml`
518-
519-
**In the `infra` directory:**
520-
1. Rename `main.bicep` to `main_custom.bicep`
521-
2. Rename `main_custom2.bicep` to `main.bicep`
522-
523-
> **Note:** This restores the original files so that standard deployments and git status remain clean.
477+
- 🔧 **Development:** See [Contributing Guide](../CONTRIBUTING.md)

infra/main.bicep

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ param azureAiServiceLocation string
4545
#disable-next-line no-unused-params
4646
param containerRegistryEndpoint string = ''
4747

48-
@description('Optional. The image tag to use for container images. Defaults to "latest_v2".')
49-
param imageTag string = 'latest_v2'
48+
@description('Optional. The image tag to use for container images. Defaults to "latest".')
49+
param imageTag string = 'latest'
5050

5151
@description('''Optional. Placeholder container image used to initially provision the container apps.
52-
The dedicated Azure Container Registry is empty right after infrastructure provisioning, so a public image is used as the default allowed image until the post-deployment script (scripts/deploy_container_images.*) builds and pushes the deployment-specific images and updates the apps. Defaults to the Azure Container Apps quickstart image.''')
53-
param placeholderContainerImage string = 'mcr.microsoft.com/k8se/quickstart:latest'
52+
The dedicated Azure Container Registry is empty right after infrastructure provisioning, so a public image is used as the default allowed image until the post-deployment script (scripts/acr_build_push.*) builds and pushes the deployment-specific images and updates the apps. Defaults to the Azure Container Apps hello-world image.''')
53+
param placeholderContainerImage string = 'mcr.microsoft.com/azuredocs/containerapps-helloworld:latest'
5454

5555
@minLength(1)
5656
@allowed(['Standard', 'GlobalStandard'])
@@ -236,13 +236,19 @@ module containerRegistry './modules/containerRegistry.bicep' = {
236236
name: containerRegistryName
237237
location: solutionLocation
238238
tags: allTags
239-
// Premium SKU in WAF/private-networking mode (supports higher throughput and
240-
// future private endpoints). Public network access is kept Enabled in both
241-
// modes so remote `az acr build` (ACR Tasks) and managed-identity pulls work;
242-
// AzureServices bypass lets trusted ACR Tasks reach the registry.
239+
// Premium SKU in WAF/private-networking mode (required for private endpoints
240+
// and network rule sets). In WAF mode public network access is Disabled at
241+
// rest; runtime pulls flow over a private endpoint and the post-deploy build
242+
// script temporarily re-enables public access for the remote `az acr build`.
243243
sku: enablePrivateNetworking ? 'Premium' : 'Standard'
244-
publicNetworkAccess: 'Enabled'
244+
publicNetworkAccess: enablePrivateNetworking ? 'Disabled' : 'Enabled'
245245
networkRuleBypassOptions: 'AzureServices'
246+
// WAF: host the registry private endpoint in the backend subnet and link it
247+
// to the privatelink.azurecr.io DNS zone so image pulls resolve privately.
248+
// Reference the VNet and DNS zone outputs directly to avoid case-sensitivity
249+
// issues with manually constructed resource IDs.
250+
privateEndpointSubnetResourceId: enablePrivateNetworking ? virtualNetwork!.outputs.backendSubnetResourceId : ''
251+
privateDnsZoneResourceId: enablePrivateNetworking ? avmPrivateDnsZones[dnsZoneIndex.containerRegistry]!.outputs.resourceId : ''
246252
// Application managed identity gets AcrPull for identity-based image pulls.
247253
acrPullPrincipalIds: [
248254
appIdentity.outputs.principalId
@@ -605,6 +611,7 @@ var privateDnsZones = [
605611
'privatelink.blob.${environment().suffixes.storage}'
606612
'privatelink.queue.${environment().suffixes.storage}'
607613
'privatelink.azconfig.io'
614+
'privatelink.azurecr.io'
608615
]
609616

610617
// DNS Zone Index Constants
@@ -616,6 +623,7 @@ var dnsZoneIndex = {
616623
storageBlob: 4
617624
storageQueue: 5
618625
appConfig: 6
626+
containerRegistry: 7
619627
}
620628

621629
// List of DNS zone indices that correspond to AI-related services.

0 commit comments

Comments
 (0)