chore: Dev to Main - #334
Conversation
…roxy for WAF (avm-waf) When AZURE_ENV_DEPLOYMENT_FLAVOR=avm-waf (enablePrivateNetworking=true), lock the chat and scenario backend App Services down to private access and reverse-proxy frontend /api/ traffic to them over the VNet. infra/avm/main.bicep: - chat_backend_app / scenario_backend_app: publicNetworkAccess Disabled when private, add 'sites' private endpoints (pep-chat-api-*, pep-scenario-api-*) on the privatelink.azurewebsites.net DNS zone - chat_frontend_app / scenario_frontend_app: set BACKEND_API_URL and clear VITE_API_BASE_URL when private; scenario VITE_CHAT_API_BASE_URL points at the public chat frontend so the embedded widget reaches the private chat backend Frontend containers (chat-app, scenario-app): - nginx.conf includes runtime-generated /etc/nginx/conf.d/api-proxy.conf - startup.sh generates the /api/ reverse proxy (with WebSocket support for voice) and serves the SPA against window.location.origin when BACKEND_API_URL is set - Dockerfile seeds an empty api-proxy.conf placeholder Recompiled infra/avm/main.json and infra/main.json. Non-WAF (bicep/avm) flavors are unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7ef3c8d0-9f97-4140-8718-76818b387d35
fix: resolve dependabot vulnerabilities
Address Copilot review feedback on PR #332: - Strip trailing slash from BACKEND_API_URL and quote the Host header so proxy_pass + the /api/ location prefix cannot produce a malformed path. - Escape values interpolated into runtime-config.js so a scenario title containing a single quote or backslash no longer breaks the generated JS. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 7ef3c8d0-9f97-4140-8718-76818b387d35
…-proxy feat: Restrict backend APIs to private access with reverse proxy
There was a problem hiding this comment.
Pull request overview
Adds support for WAF/private-networking deployments by routing frontend API calls through an nginx reverse proxy when backends are private, and updates infra templates to disable public access + provision private endpoints for backend App Services.
Changes:
- Frontends: generate runtime config that can target
window.location.originin private deployments and generate/api/reverse-proxy nginx config at startup. - Infra (AVM/WAF): disable public network access for backend apps when
enablePrivateNetworkingis on and add private endpoints + DNS zone dependencies. - Dependencies: bump axios/vite in both frontends and python-multipart in both backends.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| scenario-app/frontend/startup.sh | Adds runtime-config generation, JS-escaping helper, and startup-generated nginx /api/ proxy config for private deployments. |
| scenario-app/frontend/package.json | Bumps axios and vite versions. |
| scenario-app/frontend/package-lock.json | Lockfile updates for axios/vite bumps and transitive deps. |
| scenario-app/frontend/nginx.conf | Includes generated api-proxy.conf into server config. |
| scenario-app/frontend/Dockerfile | Ensures /etc/nginx/conf.d/api-proxy.conf exists in the image. |
| scenario-app/backend/requirements.txt | Bumps python-multipart version. |
| infra/main.json | Regenerated router template reflecting AVM/WAF private-networking changes. |
| infra/avm/main.json | Regenerated AVM/WAF ARM template with private endpoint + public access changes. |
| infra/avm/main.bicep | Implements conditional public network access + private endpoints; passes BACKEND_API_URL/VITE_* settings for private deployments. |
| chat-app/frontend/startup.sh | Adds private-deployment runtime-config behavior and startup-generated nginx /api/ proxy config. |
| chat-app/frontend/package.json | Bumps axios and vite versions. |
| chat-app/frontend/package-lock.json | Lockfile updates for axios/vite bumps and transitive deps. |
| chat-app/frontend/nginx.conf | Includes generated api-proxy.conf into server config. |
| chat-app/frontend/Dockerfile | Ensures /etc/nginx/conf.d/api-proxy.conf exists in the image. |
| chat-app/backend/requirements.txt | Bumps python-multipart version. |
Files not reviewed (2)
- chat-app/frontend/package-lock.json: Generated file
- scenario-app/frontend/package-lock.json: Generated file
Suppressed comments (2)
scenario-app/frontend/startup.sh:73
BACKEND_API_URLis written into the generated nginx config without validation. If it contains whitespace or a quote character, nginx may fail to start due to a malformed config. Add minimal validation before writing/etc/nginx/conf.d/api-proxy.conf.
location /api/ {
resolver 168.63.129.16 valid=30s;
set \$backend "${BACKEND_API_URL}";
proxy_pass \$backend;
proxy_set_header Host "${BACKEND_HOST}";
chat-app/frontend/startup.sh:43
BACKEND_API_URLis written into the generated nginx config without validation. If it contains whitespace or a quote character, nginx may fail to start due to a malformed config. Add minimal validation before writing/etc/nginx/conf.d/api-proxy.conf.
location /api/ {
resolver 168.63.129.16 valid=30s;
set \$backend "${BACKEND_API_URL}";
proxy_pass \$backend;
proxy_set_header Host "${BACKEND_HOST}";
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
refactor: Upgrade agent framework to latest version
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 46 out of 58 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- scenario-app/frontend/package-lock.json: Generated file
Suppressed comments (5)
chat-app/backend/requirements.txt:13
azure-ai-projectsis specified as>=2.3.0while other dependencies are pinned. This makes builds non-deterministic and can cause unexpected behavior changes over time.
azure-ai-projects>=2.3.0
infra/vscode_web/requirements.txt:1
azure-ai-projectsis specified as>=2.3.0, which can lead to non-reproducible environments when installing these sample dependencies. Pinning improves repeatability for users following the sample.
azure-ai-projects>=2.3.0
infra/vscode_web/endpoint-requirements.txt:1
azure-ai-projectsis specified as>=2.3.0, which can lead to non-reproducible environments when installing these sample dependencies. Pinning improves repeatability for users following the sample.
azure-ai-projects>=2.3.0
infra/scripts/post-provision/agent_scripts/requirements.txt:3
azure-ai-projectsis specified as>=2.3.0while other dependencies in this script environment are pinned. This can introduce unexpected breaking changes when a newer version is published.
azure-ai-projects>=2.3.0
scenario-app/backend/requirements.txt:14
azure-ai-projectsis specified as>=2.3.0while most other dependencies in this file are pinned. This makes deployments non-reproducible and can introduce unexpected breaking changes when a newer version is released.
Purpose
orders_plugin.pyandreference_plugin.pyplugin modules, which previously provided order and reference document handling functionality, and the deletion of the scripts for creating and listing assistants. There are also dependency and logging adjustments to improve compatibility and maintainability.Major removals:
orders_plugin.pyandreference_plugin.pymodules fromchat-app/backend/app/plugins, removing all order management and reference lookup plugin functionality. [1] [2]create_assistants.pyandlist_assistants.pyscripts fromchat-app/backend/app, eliminating programmatic creation and listing of Azure AI Foundry assistants. [1] [2]Dependency and configuration updates:
python-multipartfrom version 0.0.20 to 0.0.32 inrequirements.txtto ensure compatibility with other dependencies..flake8to ignore warningE226in addition to previous ignores, relaxing linting requirements.Logging and import changes:
main.pyto set the log level forazure.ai.projectsinstead ofagent_framework_azure_ai._client.AzureAIProjectAgentProviderinfoundry_agent_utils.pyto use the correct package name.chat.pyfor theAzureAIProjectAgentProviderinstantiation.Other:
chat-app/backend/app/plugins/__init__.py, leaving the file empty.These changes significantly reduce the backend's assistant and plugin management features, likely as part of a refactor or migration.
Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information