# Static Web Apps

Azure Static Web Apps is a managed service for hosting globally distributed web frontends with integrated deployment workflows, authentication, and optional API backends.

Cloud service · Azure. Updated 2026-11-25. Page: https://blowstack.com/tools/cloud-services-hub/static-web-apps

> Static Web Apps builds and deploys frontend assets from source repositories and serves them through a globally distributed hosting platform. It supports static sites, single-page applications, and Blazor WebAssembly applications, with managed Azure Functions APIs or separately hosted backends for server-side processing.

## 9 key features of Static Web Apps

1. **Globally distributed static hosting**: Serve generated frontend files from geographically distributed infrastructure without managing web servers. Static asset distribution does not automatically distribute a regional API or database.
2. **Repository-driven deployment**: Use GitHub Actions or Azure Pipelines to build and deploy changes from source control. Configure source and output paths explicitly, and use custom frontend build steps when automatic build detection does not match the project.
3. **Managed Functions APIs**: Deploy supported HTTP-triggered Azure Functions alongside the frontend and call them through /api. Check managed Functions runtime, region, and execution constraints before adopting libraries or workloads that require a full Functions app.
4. **Linked backend APIs**: On the Standard plan, connect a separately managed Functions app, App Service app, Container App, or API Management instance. This allows the backend to have its own deployment lifecycle and compute configuration while retaining a same-origin frontend API route.
5. **Integrated authentication and route authorization**: Use built-in Microsoft Entra ID or GitHub sign-in and restrict routes with role-based rules. Enforce record-level and operation-level authorization in backend code as well.
6. **Version-controlled routing and headers**: Define redirects, rewrites, navigation fallback, response overrides, and HTTP headers in staticwebapp.config.json. Include the configuration file in the deployed output and test both direct navigation and missing-asset behavior.
7. **Custom domains and managed TLS**: Map a custom hostname and use automatically renewed certificates. Plan DNS validation and domain cutover separately from application deployment.
8. **Preview environments**: Generate staging versions through supported pull-request workflows so reviewers can test changes before production deployment. Treat preview URLs as separate application environments and avoid connecting them to production data by default.
9. **Local development tooling**: Use the SWA CLI to serve static assets or proxy a framework development server together with a local Functions API. Its authentication emulator supports local role testing, but real identity-provider behavior must be validated in Azure.

## Where Static Web Apps is used

1. **Single-page application hosting**: Host React, Angular, Vue, or similar applications as generated static assets. Configure navigation fallback for client-side routes and expose dynamic operations through a managed or linked API.
2. **Documentation and content websites**: Publish documentation, product information, or engineering portals generated with tools such as Hugo, Gatsby, or Next.js static export. Rebuild and deploy the site when repository content changes.
3. **Authenticated employee portals**: Combine Microsoft Entra ID authentication with route restrictions and an API that enforces business permissions. For tenant-restricted access, configure the identity setup and authorization deliberately rather than treating any successful sign-in as sufficient.
4. **Blazor WebAssembly applications**: Deliver a Blazor WebAssembly client without hosting its UI in an ASP.NET Core server process. Place sensitive operations and database access behind supported managed Functions or a separately hosted backend.
5. **Independent frontend delivery for existing services**: Deploy a frontend independently of an existing App Service, Container Apps, Functions, or API Management backend. Use Standard-plan backend linking when the application needs a same-origin /api endpoint.
6. **Pull-request review environments**: Provide reviewers with a deployed version of frontend changes before merging. Supply test configuration and nonproduction API access so review activity does not modify production records.

## How Static Web Apps is priced

- **Free plan**: Provides no-charge hosting within published quotas for personal projects, learning, and evaluation. It has lower limits and lacks the production SLA and selected capabilities available with Standard; verify bandwidth, storage, environment, and domain limits before deployment.
- **Standard plan**: Provides paid hosting billed per application, with production-oriented capabilities, higher quotas, an SLA, and support for linked backends. Included bandwidth and applicable overage charges follow the current pricing terms; price separately hosted APIs and other Azure services independently.
- **Additional service and delivery costs**: A complete application can also incur charges for linked backend compute, databases, monitoring, Azure Front Door, and CI/CD usage. These charges are not eliminated by selecting a Static Web Apps hosting plan.

## Services Static Web Apps works with

A common architecture uses Static Web Apps for the browser application and Azure Functions for HTTP endpoints. The frontend calls /api on its own hostname, while the backend validates input, checks authorization, and accesses databases or other services. Managed Functions suit APIs deployed with the frontend; Standard-plan linked backends support independently operated Functions, App Service, Container Apps, or API Management resources.

Microsoft Entra ID can supply user authentication, with route rules controlling access to application paths. Backend code must still enforce business permissions, and credentials for databases or downstream services belong in server-side configuration. For database-facing applications, use an application-owned API rather than the database connections preview deprecated effective November 30, 2025. Data API Builder hosted in Container Apps is one migration option.

Azure Pipelines can coordinate tests, frontend builds, and deployment while protecting deployment credentials. Where centralized edge controls are necessary, Azure Front Door can provide the public entry point, provided origin restrictions and forwarded-host settings are configured. Validate each integration against the selected hosting model: hybrid Next.js preview does not support the linked API options available to conventional static deployments.

- **[Azure Functions](https://blowstack.com/tools/cloud-services-hub/azure-functions)**: Use managed Azure Functions for supported HTTP APIs deployed with the frontend, or link an independently provisioned Functions app on Standard. For example, a registration form can post to /api/registrations, where a function validates the request and writes to a database. Choose a separate Functions app when independent runtime configuration or regional placement is required, and verify linked-backend compatibility.
- **[App Service](https://blowstack.com/tools/cloud-services-hub/app-service)**: Link an App Service web app as the API backend on the Standard plan. For example, an existing ASP.NET Core catalog API can serve requests from a new static storefront through /api. Keep App Service scaling, application monitoring, and backend access controls in its own operational configuration.
- **[Azure Container Apps](https://blowstack.com/tools/cloud-services-hub/azure-container-apps)**: Link a Container App when the API requires a containerized runtime or independently managed dependencies. For example, deploy Data API Builder in Container Apps to provide database access after migrating away from the deprecated Static Web Apps database connections preview. Enforce database permissions in the API and keep connection credentials out of the browser bundle.
- **[API Management](https://blowstack.com/tools/cloud-services-hub/api-management)**: Link API Management on Standard to place an API gateway behind the frontend's /api route. For example, a customer portal can use APIM policies to validate credentials and route requests to multiple backend services. Ensure gateway policies and backend services enforce the required identity checks rather than assuming same-origin routing provides authorization.
- **[Azure DevOps](https://blowstack.com/tools/cloud-services-hub/azure-devops)**: Use an Azure Pipelines deployment task to build and publish the frontend and optional managed API. For example, a pipeline can run unit tests, build a monorepo frontend, and deploy its output directory after approval. Store deployment credentials in protected pipeline secrets and keep development and production deployment settings separate.
- **[Azure Front Door](https://blowstack.com/tools/cloud-services-hub/azure-front-door)**: Place Azure Front Door in front of the application when centralized routing, edge policies, or a web application firewall is required. For example, route a public portal and its other origins through one Front Door profile. Configure allowed forwarded hostnames and the documented required-header restrictions so users cannot bypass the intended entry point through the default application hostname.
- **[Azure Application Gateway](https://blowstack.com/tools/cloud-services-hub/azure-application-gateway)**: A Standard static web app can receive traffic through Application Gateway over a private endpoint. The gateway uses private DNS to resolve the app and sends the app’s hostname in backend requests so Static Web Apps can route them correctly.
- **[Azure Content Delivery Network](https://blowstack.com/tools/cloud-services-hub/azure-content-delivery-network)**: A static web app can serve as the origin for an existing Azure Content Delivery Network endpoint. The endpoint fetches cacheable assets, such as images and JavaScript bundles, from the app and serves them from CDN edge caches.
- **[Azure DNS](https://blowstack.com/tools/cloud-services-hub/azure-dns)**: Static Web Apps uses records in an Azure DNS zone to validate and route custom domains. For example, a CNAME can point `www.example.com` to the app’s default hostname, while a TXT record can verify ownership of an apex domain.
- **[Azure Key Vault](https://blowstack.com/tools/cloud-services-hub/azure-key-vault)**: Static Web Apps can use its managed identity to read a custom authentication provider’s client secret from Key Vault. The app setting holds a Key Vault reference rather than the secret itself.
- **[Azure Monitor](https://blowstack.com/tools/cloud-services-hub/azure-monitor)**: Static Web Apps exposes platform metrics in Azure Monitor. An app with a managed API can also enable Application Insights to track API requests, failures, and traces.
- **[Azure Policy](https://blowstack.com/tools/cloud-services-hub/azure-policy)**: Static Web Apps resources can be evaluated by Azure Policy using their resource properties. For example, a policy can audit static web apps whose public network access is enabled.
- **[Azure portal](https://blowstack.com/tools/cloud-services-hub/azure-portal)**: Static Web Apps has a dedicated management experience in the Azure portal. From it, you can create an app, add a custom domain, link an API backend, and inspect deployed environments.
- **[Azure Private Link](https://blowstack.com/tools/cloud-services-hub/azure-private-link)**: A Standard static web app can use a Private Link endpoint so clients reach it over a private IP instead of the public internet. The private endpoint provides private access to the production app and its staging environments.
- **[Azure Resource Manager](https://blowstack.com/tools/cloud-services-hub/azure-resource-manager)**: Static Web Apps is provisioned through Azure Resource Manager as a `Microsoft.Web/staticSites` resource. An ARM template can create the app and configure related resources such as custom domain bindings.
- **[Azure role-based access control (Azure RBAC)](https://blowstack.com/tools/cloud-services-hub/azure-role-based-access-control-(azure-rbac))**: Static Web Apps uses Azure RBAC to control who can manage the Azure resource. For example, a Reader role assignment lets someone inspect the resource without changing its settings; it does not grant access to protected routes in the website.
- **[Azure Virtual Network](https://blowstack.com/tools/cloud-services-hub/azure-virtual-network)**: A Standard static web app can be reached through a private endpoint in an Azure Virtual Network subnet. Clients with network connectivity and private DNS resolution can open the site using its private IP.
- **[Azure Web Application Firewall](https://blowstack.com/tools/cloud-services-hub/azure-web-application-firewall)**: Static Web Apps can sit behind a separately configured Azure Front Door profile with a Web Application Firewall policy. The firewall inspects requests and can block common web attacks before they reach the static web app.
- **[Microsoft Entra External ID](https://blowstack.com/tools/cloud-services-hub/microsoft-entra-external-id)**: A Standard static web app can use a Microsoft Entra External ID external tenant as a custom OpenID Connect provider. Customers sign in through an External ID user flow before accessing routes that require authentication.
- **[Microsoft Entra ID (formerly Azure AD)](https://blowstack.com/tools/cloud-services-hub/microsoft-entra-id-(formerly-azure-ad))**: Static Web Apps has a built-in Microsoft Entra ID sign-in provider and supports a custom registration for tenant-specific sign-in. The app can require authenticated users or assigned roles on selected pages and API routes.
- **[Microsoft Entra ID B2C](https://blowstack.com/tools/cloud-services-hub/azure-active-directory-b2c)**: A Standard static web app can register an existing Microsoft Entra ID B2C tenant as a custom OpenID Connect provider. The app can direct visitors through a B2C sign-up or sign-in flow before granting access to protected routes.

## Alternatives to Static Web Apps in other clouds

### AWS

**[AWS Amplify](https://blowstack.com/tools/cloud-services-hub/aws-amplify)**: Amplify Hosting, part of AWS Amplify, and Azure Static Web Apps both build and deploy web apps from source repositories. Amplify Hosting bills by usage and supports server-side rendering for Next.js, while Azure Static Web Apps offers a quota-limited Free plan and a per-app Standard plan and hosts Next.js static exports.

| | Static Web Apps | AWS Amplify |
| --- | --- | --- |
| Hosting billing | Free within quotas; Standard per app | Usage-based |
| Next.js hosting | Static exports | Server-side rendering |

Compared Nov 2026.

## What is Static Web Apps

Azure Static Web Apps separates frontend hosting from backend execution. HTML, CSS, JavaScript, WebAssembly, and images are distributed globally, while API requests run on managed Azure Functions or a linked backend. Selecting a resource region determines the location of the managed Functions API, not a geographic boundary for static content. Applications with strict data-residency requirements should assess this distinction before selecting the service.

A typical deployment starts with a GitHub repository or Azure DevOps project. A workflow builds the application and deploys its generated assets, along with an optional managed API. Configure the application source directory, API directory, and build output directory explicitly, particularly for monorepos. Custom build steps can produce frontend artifacts before the deployment task runs. Protect deployment tokens as CI/CD secrets and never commit them to source control.

Application behavior is configured in staticwebapp.config.json. This file controls routes, authorization rules, response headers, redirects, response overrides, and navigation fallback. Ensure the build copies it into the root of the deployed output. For a single-page application, configure navigation fallback so that a direct request to a client-side route returns the application entry point. Exclude asset paths from fallback where missing files should return an actual error rather than HTML.

Built-in authentication supports Microsoft Entra ID and GitHub, and route rules can restrict access by role. Authentication and business authorization remain separate concerns: an authenticated user must still be checked for permission to access individual records or execute sensitive operations. Keep database credentials and other secrets in backend configuration, not frontend environment variables that are embedded in downloadable JavaScript.

For APIs, managed Functions provide a deployment model tied to the web application. Standard accounts can instead link supported Azure Functions, App Service, Container Apps, or API Management backends. The /api route gives browser code a same-origin endpoint without requiring custom browser CORS configuration for that path. Backend capacity, supported runtimes, access controls, and availability still require separate consideration.

Custom domains and automatically renewed TLS certificates support production hosting. Pull-request preview environments allow reviewers to test changes before merging, subject to workflow support and plan quotas. The Static Web Apps CLI approximates hosting, routing, and authentication locally, but its mock identity system does not replace testing with the real identity provider.

Static exports from frameworks such as Next.js fit the static hosting model. Hybrid Next.js hosting is a separate preview capability with restrictions, including unsupported linked APIs and SWA CLI emulation and deployment. The Dedicated preview pricing plan was retired on October 31, 2025. The database connections preview was deprecated effective November 30, 2025; applications using it should migrate to an application-owned API, such as Data API Builder hosted in Azure Container Apps.
