beta → go transition
Both hosts are served by the same App Service behind one Front Door. Sign-in, canonical links, robots, the sitemap and the version label are already per host. What remains is the move itself: sending beta visitors to go. Because the move is not approved yet, it is a runtime switch, not a deploy.
The two flags
Feature flags live in the shared SQL table and are toggled on the Admin UI's Feature Flags page. Consumers read them on their next request, so a flip takes effect within about a minute and needs no deploy, Terraform apply or restart.
| Flag | Off | On |
|---|---|---|
redirect-beta-to-go | Nothing changes anywhere. | Every request whose public host is exactly beta.alertcalifornia.org is answered with a redirect to the same path and query on go.alertcalifornia.org. |
redirect-beta-to-go-permanent | The redirect is a 307. Browsers never cache it, so turning the first flag off is effective for everyone at once. | The redirect is a 308. Browsers and search engines treat the move as permanent. Flip only after the go / no-go call. |
Create both flags in the Admin UI (they do not exist until someone creates them) and leave both off until the rehearsal.
What follows the flag
- The redirect lives in
proxy.ts, decided bylib/transitionRedirect.tsbefore any session work. The flags are read through the app's own/api/feature-flagson the loopback address and cached for a minute (lib/server/transitionFlags.ts). A failed read counts as off: a backend hiccup can never start a redirect. - Alert emails (Notification function) link to the camera on go when the flag is on, instead of relying on the redirect.
- The Admin UI builds its "open on public site" links from the flag, and the ESRI map sync fetches its ArcGIS token from the host the flag names. The sync needs this: .NET drops the
Authorizationheader when a redirect crosses hosts.
Exempt from the redirect on beta: /api/healthcheck (Front Door and the availability test probe both hosts) and /api/csp-report (violation reports from any open beta tab still need somewhere to go).
Rehearsal and rollback
- Turn
redirect-beta-to-goon. Open beta: it lands on go with the path and query intact. Sign in on go; check PTZ, share links, an alert email link. - Turn it off. Beta serves again immediately, because nothing cached the 307.
- Old beta tabs that stay open after the flip see their API calls redirected across origins and fail; the app shows them signed out and a reload lands on go. That is the intended nudge.
Front Door does not cache 307 or 308 responses, so nothing has to be purged on a rollback.
After approval: the cleanup that is not flag-driven
These are Terraform, Entra or Front Door state rather than runtime behaviour, so they change once, after the permanent flag is on and stable:
environment_domains.prd→https://go.alertcalifornia.org, andtransition_origins.prd/transition_custom_domainsfolded into the primary values (Alert.CA.Terraformlocals.tf,locals.frontdoor.tf).JWTOptions:FrontendRedirectUriandEntraOptions:RedirectUriin App Configuration (locals.appconfig.tf) → go.- Entra
azure_frontend_uri(Alert.CA.Terraform.EntraIDenvironments/prd.tfvars) → go; keep the beta redirect URIs until the last beta session has expired. - Replace the app-level redirect with a Front Door rule set (
url_redirect_action, 308) on the beta domain and drop beta from the origin routes, so beta never reaches the App Service. Then delete the flags and this code path. PRIMARY_PUBLIC_HOSTinlib/publicHost.ts→ go (the fallback for a host that is not allow-listed).- Retire the beta custom domain once the 308 has been in place for as long as search engines need, typically a few months.