fix: avm+waf deployment - #1128
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves deployment robustness for both AVM and vanilla Bicep flows when initially provisioning Container Apps with the public Microsoft bootstrap image (mcr.microsoft.com/azuredocs/containerapps-helloworld). It does this by conditionally configuring Container App ingress ports and registry settings based on whether the bootstrap image is being used, and by updating the post-provision scripts to swap images and ports after build/push.
Changes:
- Add “bootstrap image” detection variables and use them to set
ingressTargetPortto80(bootstrap) vs8000/9000(real backend/MCP images). - Set Container App
registriestonullwhen using the public bootstrap image (avoids unnecessary ACR auth config). - Update post-provision image push scripts to update both image and ingress port for backend/MCP container apps.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| infra/scripts/post-provision/Build-And-Push-Images.ps1 | Adds a helper to update Container App image + ingress port + registries during post-provision. |
| infra/scripts/post-provision/build_and_push_images.sh | Adds a jq-based helper to update Container App image + ingress port + registries during post-provision; enforces jq presence. |
| infra/main.json | Updates generated router template to include bootstrap-image conditionals for ingress ports/registries. |
| infra/bicep/main.json | Updates generated vanilla Bicep ARM template with bootstrap-image conditionals and related settings. |
| infra/bicep/main.bicep | Adds bootstrap-image conditionals for Container App ingress target ports and registry config. |
| infra/avm/main.json | Updates generated AVM ARM template with bootstrap-image conditionals and related settings. |
| infra/avm/main.bicep | Adds bootstrap-image conditionals for Container App ingress target ports and registry config. |
Suppressed comments (1)
infra/avm/main.json:59688
- The frontend Web App container listens on port 3000 (src/App/Dockerfile exposes 3000 and runs uvicorn on 3000), but WEBSITES_PORT isn’t set in these appSettings. That will prevent App Service from routing traffic to the container until the post-provision script patches settings, and breaks deployments that don’t run the post-provision hook.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Ayaz-Microsoft
marked this pull request as ready for review
August 6, 2026 14:28
Roopan-Microsoft
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces logic to better support deployments using the default Microsoft bootstrap container image (
azuredocs/containerapps-helloworld) for both backend and MCP container apps. The main improvements are conditional configuration of container port and registry settings based on the image in use, as well as several infrastructure and configuration updates.Conditional container app configuration:
backendUsesBootstrapImage,mcpUsesBootstrapImage) to check if the Microsoft bootstrap image is used for backend or MCP containers. [1] [2] [3]ingressTargetPortto use port 80 when the bootstrap image is used, otherwise defaulting to the previous ports (8000 for backend, 9000 for MCP). [1] [2] [3] [4] [5] [6]registriestonullwhen using the bootstrap image, otherwise configured as before. This avoids unnecessary registry authentication for public images. [1] [2] [3] [4] [5] [6]Infrastructure and configuration updates:
main.jsonfiles to reflect the above logic and other minor changes. [1] [2] [3] [4] [5]vnetRouteAllEnabled,imagePullTraffic, and new image-related environment variables. [1] [2] [3] [4] [5]virtualMachineAvailabilityZoneto-1inmain.json.These changes make the deployment templates more robust and flexible, especially when using the default Microsoft bootstrap container image, and improve overall infrastructure configuration.
Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information