Make .devcontainer and .vscode port references configurable

Author: pamelafoxCreated Jun 26, 2026Updated Sep 18, 2026
Labelsenhancement

Summary

Follow-up to #3116. The .devcontainer/devcontainer.json port forwarding and .vscode/tasks.json / .vscode/launch.json still hardcode port 50505. These should ideally be configurable for parallel worktree usage.

Context

PR #3117 made app/start.sh, app/start.ps1, and app/frontend/vite.config.ts configurable via PORT and BACKEND_PORT env vars. However, VS Code config files don't natively support env vars with defaults, making this non-trivial.

Files affected

  • .vscode/tasks.json (line 62): "-p", "50505"
  • .vscode/launch.json (line 25): "-p 50505"
  • .devcontainer/devcontainer.json (line 27): port forwarding

Challenges

VS Code's variable substitution (${env:PORT}) resolves to empty string when the env var is unset — there's no way to specify a default. Possible approaches:

  • Accept that each worktree edits their own .vscode/ files (since each worktree has its own copy)
  • Require developers to set PORT before opening VS Code (PORT=50506 code .)
  • Use a VS Code extension or input variable (adds friction)

Acceptance criteria

  • Developers running two worktrees can use different ports without manual edits, OR clear documentation explains how to change the port per-worktree.

Source: Azure-Samples/azure-search-openai-demo