ADR-0027 — Host ION single-page applications on Azure Static Web Apps
Forces / Drivers
- Requirement / Constraint: ION needs a consistent, secure, production-supported hosting model optimized for browser-delivered SPAs and the independently deployed frontend units defined by ADR-0023.
- Principle(s) embodied: § 14 Independent scalability, § 17 Failure containment, and § 23 Blast-radius containment.
- WAF pillar optimized:
operational-excellence(primary);performance-efficiency,cost-optimization,security, andreliability(secondary).
Context
ION’s browser applications are SPAs whose deployable output is static HTML, CSS, JavaScript, images, and runtime composition metadata. The frontend hosting layer does not need a continuously running application process. BFFs and domain APIs remain independently deployed server-side workloads.
ADR-0026 selected Azure App Service as the initial hosting standard. Although App Service can host SPAs, it is a general-purpose runtime platform. Azure Static Web Apps is purpose-built for static frontend delivery and provides globally distributed content, managed TLS certificates and custom domains, GitHub and Azure DevOps integration, pull-request preview environments, SPA navigation fallback, configurable response headers and routes, and integration with existing APIs.
Microsoft positions the Static Web Apps Standard plan for production applications that require an SLA, private endpoints, custom authentication registrations, increased limits, or linked backends. These capabilities align more closely with ION’s production, identity, networking, and delivery requirements than the Free plan.
Decision
All ION browser-delivered web applications SHALL be implemented as SPAs and SHALL host their compiled frontend assets on Azure Static Web Apps. Production workloads SHALL use the Standard plan.
This decision supersedes ADR-0026. It applies to application shells and independently deployable frontend bundles, including the micro-frontends defined by ADR-0023. BFFs, APIs, and domain services SHALL remain separately hosted and SHALL be reached through the platform’s approved API and edge topology; selecting Static Web Apps does not move backend authorization or domain logic into the browser.
Web apps do not implement APIs
Azure Static Web Apps instances SHALL host only the compiled SPA (HTML, CSS, JavaScript, images, staticwebapp.config.json, and runtime composition metadata). They MUST NOT publish APIs, act as BFFs, terminate user or service tokens, perform domain authorization, or contain domain logic.
Specifically, the following Static Web Apps features are prohibited on the ION Platform because they conflict with the API topology defined in ADR-0015 and the APIM policy boundary defined in ADR-0014:
- Managed Azure Functions APIs exposed under the
/api/*prefix of the Static Web App. - Bring-your-own Functions / App Service / Container Apps / APIM link as an SWA-integrated backend that would be published under the Static Web App hostname.
- Any use of the SWA reverse-proxy
/api/*route to reach a BFF or backend directly.
BFFs, APIs, and domain services are separately deployed workloads governed by ADR-0013, ADR-0014, ADR-0020, and ADR-0023. The browser reaches them through the platform edge, not through the Static Web App.
Traffic path (per ADR-0015)
The ION Platform edge topology in ADR-0015 is the sole authoritative traffic pattern and applies here, including its bounded edge exceptions:
Browser HTML/JS/CSS request:
user → Azure Front Door (platform WAF) → Application Gateway → Azure Static Web Apps (SPA assets)
Browser XHR / fetch to an API:
user → Azure Front Door (platform WAF) → Application Gateway → APIM → BFF → downstream service
Static Web Apps instances SHALL be reachable only through Front Door. Front Door normally reaches them through Application Gateway, and directly only as a priority-2 failover origin. Configuration MUST enforce this:
- Public ingress is restricted so only the platform Front Door/Application Gateway path can reach the Static Web App (Standard-plan private endpoint and/or
staticwebapp.config.jsonnetworking.allowedIpRanges/forwardingGatewaywith theAzureFrontDoor.Backendservice tag and the requiredX-Azure-FDIDheader). staticwebapp.config.jsonMUST NOT declare route rules, rewrites, or fallbacks that proxy/api/*(or any API-shaped path) to a linked backend, managed Functions app, or any non-static resource.navigationFallbackMUST exclude API-shaped paths so they cannot be silently rewritten toindex.html.- Frontend code MUST call the platform’s APIM-fronted API hostname (reached via Front Door → Application Gateway → APIM), not a same-origin
/api/*path on the Static Web App. - Direct public exposure of the Static Web App and any “API route on the web app” pattern are prohibited. A direct Front Door→SWA origin is permitted only as the priority-2 origin of a Front Door origin group whose priority-1 origin is Application Gateway, and it MUST accept only ION’s Front Door (
AzureFrontDoor.Backendservice tag plus theX-Azure-FDIDheader).
Implementations SHALL:
- Provision Static Web Apps and related configuration through the platform’s approved infrastructure-as-code modules and deploy through the CI/CD controls in ADR-0024.
- Configure SPA deep-link fallback with
navigationFallbackinstaticwebapp.config.jsonand exclude static asset paths that should return genuine404responses. - Define security headers, route behavior, and networking controls in
staticwebapp.config.json; validate the content-security policy against each shell’s Module Federation requirements. - Use managed custom-domain certificates and the platform-approved domain naming convention.
- Treat browser route restrictions as user-experience controls only. BFFs and APIs MUST authenticate and authorize every request because client-side routes and files cannot protect sensitive data. Static Web Apps built-in authentication and
allowedRolesroute protection MUST NOT be used as an API authorization boundary; the authoritative boundaries are APIM (ADR-0014) and the BFF (ADR-0013). - Use Microsoft Entra ID registrations and authorization boundaries consistent with ADR-0009, ADR-0010, ADR-0013, and ADR-0023. Static Web Apps authentication SHALL NOT replace the capability contract or backend authorization model.
- Integrate telemetry with ADR-0021, including deployment/version correlation and client-side exception, dependency, availability, and performance signals.
- Use immutable, content-hashed filenames and long-lived cache headers for versioned assets; avoid long-lived caching for shell HTML and runtime federation manifests so deployments can take effect safely.
- Validate Standard-plan quotas, regional availability, SLA, private-link behavior, data residency, and disaster-recovery requirements during each workload’s architecture review.
Any workload that requires server-side rendering, a long-running web process, unsupported response manipulation, runtime filesystem access, or another capability unavailable in Static Web Apps requires a separate exception ADR and may use App Service or another approved compute service. Such an exception SHALL NOT be used to publish APIs from the web-hosting resource; API workloads remain behind APIM per ADR-0015 and ADR-0014.
Alternatives considered
- Azure App Service — Provides broad runtime support, deployment slots, autoscaling, networking, and managed platform capabilities. Rejected as the default for compiled SPAs because an application runtime adds standing compute, configuration, scaling, and patching concerns without adding value to static asset delivery. It remains an exception option for runtime-backed web workloads.
- Azure Storage static website with Azure Front Door/CDN — Efficiently serves static content and permits composable edge designs. Rejected as the default because Static Web Apps integrates repository-driven deployment, preview environments, SPA fallback, certificates, routing, authentication integration, and API linkage with less platform assembly.
- Container Apps, AKS, or virtual machines — Rejected because static frontend assets do not require a container scheduler or operating-system lifecycle.
- Server-side rendering as the platform default — Rejected because ION’s authenticated application surfaces have no established platform-wide SEO or first-render requirement that outweighs added runtime complexity. Workload-specific exceptions remain possible.
- Static Web Apps Free plan for production — Rejected because it has no SLA or private endpoints and uses service-defined authentication providers; Standard is Microsoft’s production-oriented plan.
Rationale
Static Web Apps matches the workload rather than merely supporting it. Removing the frontend application runtime narrows the operational and security surface, while global static-content distribution improves delivery efficiency. Repository integration, automated builds, managed certificates, and pull-request preview environments make independent frontend delivery easier and reinforce the ownership model in ADR-0023.
The Standard plan is selected because production ION applications need SLA-backed hosting and may require private endpoints, custom Entra registrations, linked APIs, and higher limits. Separating static delivery from BFF/API compute also allows each tier to scale, deploy, and recover according to its own characteristics.
Consequences
Positive
- Static assets are delivered through a globally distributed service without an application runtime dedicated to file serving.
- Teams receive integrated GitHub/Azure DevOps deployment and pull-request preview environments.
- Managed certificates, custom domains, SPA fallback routing, headers, route configuration, and API integration reduce bespoke platform assembly.
- Frontend and backend capacity, deployment cadence, failure domain, and cost model remain independent.
- The service aligns with React and other SPA frameworks used by ION.
Negative
- Static Web Apps service limits, supported features, regional behavior, and Standard-plan capabilities constrain workloads more than general-purpose App Service.
- Private networking and an additional forwarding gateway or Azure Front Door design can change global-distribution behavior and require explicit validation against ADR-0015 and ADR-0016.
- Pull-request environments can expose pre-production content unless access, secrets, test data, lifecycle, and cleanup are governed.
- Module Federation requires careful caching and content-security-policy configuration to avoid stale manifests or blocked remote bundles.
- Existing App Service deployments require planned migration, DNS/certificate cutover, configuration translation, and rollback procedures.
Neutral / follow-ups
- BFFs and APIs continue to use their independently selected compute services and authorization controls.
- Platform engineering must provide reusable IaC, workflow,
staticwebapp.config.json, security-header, caching, custom-domain, telemetry, and migration patterns. - Each production workload must confirm service quotas and resilience requirements; this ADR does not assert that one Static Web Apps resource satisfies every workload’s RTO, RPO, or regional-residency needs.
WAF Pillar Impact
- Security: A static hosting service removes the general-purpose frontend runtime and supports managed TLS, custom Entra registrations, route controls, headers, IP restrictions, and private endpoints on Standard. Sensitive data remains protected only by authenticated and authorized APIs; preview environments, CSP, supply-chain controls, and public/private ingress require governance.
- Reliability: Standard provides an SLA and managed global content distribution. Immutable assets and independent frontend deployments reduce coupling, but teams must design rollback, cache invalidation, dependency failure behavior, and any multi-region/DR measures needed beyond the service SLA.
- Performance Efficiency: Globally distributed static delivery, cacheable content-hashed assets, and no runtime worker improve latency and remove frontend compute scaling. Incorrect caching of HTML or Module Federation manifests can delay or break releases.
- Cost Optimization: Static hosting avoids always-on App Service compute dedicated to serving files. Standard-plan charges, bandwidth, preview environments, linked backends, monitoring, private endpoints, and edge services must still be governed and tagged.
- Operational Excellence (primary): Repository-driven deployment, preview environments, managed certificates, declarative routing, and removal of frontend runtime operations simplify repeatable delivery. Platform modules and guardrails are required to prevent configuration drift across many shells and MFEs.
- Trade-offs: ION accepts a more constrained hosting service and service-specific deployment model in exchange for better workload fit, lower runtime toil, global static delivery, and stronger frontend delivery ergonomics.
Previous approach (ADR-0026)
ADR-0026 required SPAs to host compiled assets on Azure App Service. That approach standardized on a mature managed runtime but required ION to operate and pay for application compute merely to serve static files. This ADR retains the SPA architectural choice while replacing the hosting service with Azure Static Web Apps Standard. App Service remains available only where a workload has documented runtime requirements that Static Web Apps cannot satisfy.
Amendments
- 2026-10-15 — Edge path aligned with ADR-0015. Front Door Premium WAF is the platform WAF. Application Gateway runs without WAF, so the traffic paths no longer show “Application Gateway (+ WAF)”. A direct Front Door→SWA origin is permitted only as a priority-2 failover origin behind Application Gateway, locked to ION’s Front Door with the service tag and
X-Azure-FDID. - 2026-10-15 — Recorded exception: operational-data continuity portal. The read-only operational-data portal (
portal.opsdata, Vishnu) is hosted on an Azure Storage static website with RA-GZRS. Front Door routes to it directly, with priority-2 origins on the Switzerland West secondary read endpoints. Static Web Apps has no read-access geo-secondary, and the portal must stay readable during a Switzerland North outage, independent of Application Gateway, APIM, and the BFFs. The portal has no API surface. It reads JSON from Storage with the user’s Entra token and Storage RBAC, and shared-key access is disabled. This is the only approved Storage-static-website SPA, and this amendment is its exception record. ADR-0015 lists it as a permitted edge exception.
References
- Microsoft Learn: What is Azure Static Web Apps?
- Microsoft Learn: Azure Static Web Apps hosting plans
- Microsoft Learn: Configure Azure Static Web Apps
- Microsoft Learn: App Service overview
Related ADRs
- Supersedes: ADR-0026
- Related: ADR-0023 — SPA/MFE composition, runtime loading, and frontend ownership model.
- Related: ADR-0024 — standard CI/CD and infrastructure-as-code runway.
- Related: ADR-0015 — authoritative edge topology. Web traffic reaches Static Web Apps through Front Door → Application Gateway, or directly from Front Door only as a priority-2 failover origin. API traffic goes Front Door → Application Gateway → APIM → BFF. Static Web Apps
/api/*integration and linked backends are prohibited. - Related: ADR-0014 — APIM is the sole API policy boundary; web apps never publish APIs.
- Related: ADR-0016 — private networking baseline.
- Related: ADR-0021 — frontend and platform observability baseline.
- Related: ADR-0009, ADR-0010, and ADR-0013 — identity and authorization boundaries.