Overview of API support in Azure Static Web Apps
Front end web applications often call back end APIs for data and services. Azure Static Web Apps provides built-in serverless API endpoints via integration with Azure services.
Key features of Azure Static Web Apps APIs include:
Integrated security with direct access to user authentication and role-based authorization data.
Seamless routing that makes the
/apiroute available to the front-end web app without requiring custom CORS rules.
The following Azure services can be integrated with Azure Static Web Apps:
|Service||Managed||Bring your own|
|Azure API Management||✔|
|Azure App Service||✔|
|Azure Container Apps||✔|
- Managed APIs: By default, Azure Static Web Apps automatically integrates with Azure Functions as an API backend. You deploy an API with your static web app without managing a separate Azure Functions resource.
- Bring your own APIs: You can integrate your static web app with existing APIs hosted in Azure Functions, API Management, App Service, or Container Apps. You manage and deploy the API resources yourself.
Bring your own APIs is only available in the Azure Static Web Apps Standard plan. Built-in, managed Azure Functions APIs are available in all Azure Static Web Apps plans.
The following constraints apply to all API backends:
- Each static web app environment can only be configured with one type of backend API at a time.
- The API route prefix must be
- Route rules for APIs only support redirects and securing routes with roles.
- Only HTTP requests are supported for APIs. WebSocket, for example, is not supported.
- The maximum duration of each API request 45 seconds.
Submit and view feedback for