I've always been fascinated by the JAMstack - a static frontend, serverless API setup that simplifies web development. Microsoft took a big step towards embracing this model with Azure Static Web Apps, which launched in preview in May 2020 and expanded throughout the year. It integrates tightly with GitHub Actions, making it easy to build and deploy static web sites with a serverless backend.

Under the hood, Azure Static Web Apps hosts static web assets on a globally distributed CDN and pairs them with Azure Functions for dynamic API endpoints. The same hosting unit handles CORS and authentication automatically, eliminating the need for tedious configuration. And with GitHub Actions on board, builds and deployments happen with zero additional setup.

Running Azure Functions in the consumption plan works fine for low traffic, but I’ve seen cold-start latency creep past 5 seconds when the function bundle exceeds 50 MB. In a production portal that served 200 requests per second, we switched to the Premium plan, paid roughly $0.10 per vCPU‑hour, and cut the 95th‑percentile latency from 7 seconds to under 200 ms. The static assets themselves are cheap – a CDN egress of 1 TB in North America was about $20 in the 2020 pricing – but you still need to watch the build artifact size because each megabyte adds to the edge cache warm-up time.

One of the most exciting features of Azure Static Web Apps is its built-in authentication support. With a single click, you can enable authentication via Azure AD, GitHub, Twitter, or Google without writing a line of code. Routes can be restricted to authenticated users or specific roles, and configuring role-based access is a breeze compared to manual Azure AD app registrations.

The auth flow injects a JWT into the request header, and the Functions runtime automatically validates it against the built-in identity provider. In practice you still have to pull the token from the "x‑ms‑token‑fwd" header inside the function and verify the claims if you’re authorizing against custom roles. I ran into a snag when a GitHub organization required SAML SSO – the static web app’s GitHub provider ignored the extra step, forcing us to fall back to Azure AD and manually register the app to get the required scopes.

Another significant advantage of Azure Static Web Apps is its staging environment feature. When you create a pull request, the service creates an ephemeral staging environment with a unique URL that persists until the PR is merged. This is a game-changer for content sites, documentation, and component libraries, where preview environments per PR make the review process much easier.

Each pull‑request preview spins up its own Function app and CDN endpoint, which means the subscription can hit the default limit of 20 Function apps per resource group if you have many concurrent PRs. We added a cleanup script that runs on the "closed" event of a PR to delete the staging slot, bringing the daily cost down from a few dollars to zero. Also, the GitHub Actions runner for each preview uses the same Azure credentials, so you have to watch the token expiration – a 90‑day token expired in the middle of a long‑running feature branch and broke the preview until we refreshed it.

Azure Static Web Apps also shines when it comes to Blazor WebAssembly support. With the .NET WASM runtime served from the CDN alongside the application assemblies, Blazor WASM applications get the same benefits as other static web sites - global CDN distribution, preview deployments per PR, and Azure Functions for server-side API calls. The development experience is surprisingly seamless, making it the closest to a managed deployment story Blazor WASM has seen yet.