Skip to content

Static Web Apps

The solution uses Azure Static Web Apps (SWA) to host the fully-static frontend applications and documentation site. SWA provides global CDN distribution, custom domain and TLS management, and built-in preview environment support for pull requests.

SWA ResourceSurfaceEnvironmentResource Group
swa-agent-testAgent AppTestrg-application-test
swa-agent-prodAgent AppProductionrg-application
swa-customer-testCustomer AppTestrg-application-test
swa-customer-prodCustomer AppProductionrg-application
swa-maxconf-docsDocs SiteSingle environmentrg-shared-resources

SWA deployments use deployment tokens - API tokens scoped to a specific Static Web App that authorize uploads without requiring full Azure RBAC credentials.

  • Each SWA has its own deployment token stored as a GitHub Actions environment secret (e.g., SWA_AGENT_APP_DEPLOYMENT_TOKEN).
  • Tokens are passed to the Azure/static-web-apps-deploy@v1 action.
  • No build step is required for agent-app and customer-app - they are plain static files deployed from src/ directly.
  • The docs site requires a build step (pnpm nx run docs:build) before deployment.

When a pull request is opened against main that modifies an SWA surface, a preview environment is deployed automatically. This provides a temporary staging URL for reviewing changes before merge.

  • Preview environments are created by the test workflow’s deploy-preview job.
  • When the PR is closed (merged or abandoned), a close_pull_request job runs to clean up the preview environment.
  • The preview URL is posted as a comment on the PR by the SWA deploy action.

Static Web Apps support custom domain binding with automatic TLS certificate provisioning. Domain configuration is managed in the Azure portal under each SWA’s Custom domains settings.

Both agent-app and customer-app include a staticwebapp.config.json file that controls SWA routing behavior (navigation fallback, response headers, etc.).