Skip to content

feat: Restrict backend Container App to private access in WAF deployment#904

Open
Prajwal-Microsoft wants to merge 11 commits intodev-v4from
feature/39249-waf-api-private-access
Open

feat: Restrict backend Container App to private access in WAF deployment#904
Prajwal-Microsoft wants to merge 11 commits intodev-v4from
feature/39249-waf-api-private-access

Conversation

@Prajwal-Microsoft
Copy link
Copy Markdown
Contributor

Purpose

When enablePrivateNetworking (WAF mode) is active, the backend Container App was still publicly accessible via external ingress. This PR restricts the backend to internal-only access while keeping the frontend Web App publicly reachable.

Changes

Infrastructure (infra/main.bicep & infra/main_custom.bicep):

  • Container App Environment: Set internal: true and publicNetworkAccess: 'Disabled' in WAF mode
  • Container App ingress: Set ingressExternal: false in WAF mode (internal-only)
  • Frontend App Service: Added PROXY_API_REQUESTS env var to enable server-side proxying

Frontend (src/frontend/):

  • frontend_server.py: Added httpx-based reverse proxy for /api/* routes in WAF mode. /config endpoint returns same-origin /api URL so browser calls frontend instead of backend directly
  • requirements.txt: Added httpx dependency

Architecture (WAF mode)

Browser -> Frontend App (public) -> FastAPI /api/* proxy -> VNet -> Container App (internal ingress)

Non-WAF deployments are unchanged.

Resolves AB#39249

Does this introduce a breaking change?

  • Yes
  • No

How to Test

# Copy WAF params and deploy
cp infra/main.waf.parameters.json infra/main.parameters.json
azd up

Verify:

  • Backend Container App FQDN is not reachable from public internet
  • Frontend App https://app-{suffix}.azurewebsites.net -> 200 OK
  • /config endpoint returns /api (same-origin) in WAF mode

What to Check

  • Backend Container App is not publicly accessible in WAF deployment
  • Frontend Web App is publicly accessible
  • Multi-agent automation features work end-to-end
  • Non-WAF deployment still works as before

Other Information

Related PRs: microsoft/customer-chatbot-solution-accelerator#173

Vamshi-Microsoft and others added 11 commits March 18, 2026 13:34
ci: refactor notification email templates
ci: update email subjects to include status icons
test: updated the testcases to the latest agent framework. Dev v4 to main
fix: Dev v4 to main merge
When enablePrivateNetworking (WAF mode) is active:
- Set Container App Environment to internal with public access disabled
- Set Container App ingress to internal (not externally accessible)
- Frontend Python server proxies /api/* requests to backend over VNet
- /config endpoint returns same-origin /api URL in WAF mode
- Non-WAF deployments remain unchanged (direct public API access)

Resolves AB#39249

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants