API support in Azure Static Web Apps with Azure Functions
Article
Front end web applications often callback end APIs for data and services. By default, Azure Static Web Apps provides built-in serverless API endpoints via Azure Functions.
Azure Functions APIs in Static Web Apps are available in two possible configurations depending on the hosting plan:
Managed functions: By default, the API of a static web app is an Azure Functions application managed and deployed by Azure Static Web Apps associated with some restrictions.
Bring your own functions: Optionally, you can provide an existing Azure Functions application of any plan type, which includes all the features of Azure Functions. With this configuration, you're responsible to handle a separate deployment for the Functions app.
The following table contrasts the differences between using managed and existing functions.
API endpoints are available to the web app through the api route.
Managed functions
Bring your own functions
While the /api route is fixed, you have control over the source code folder location of the managed functions app. You can change this location by editing the workflow YAML file located in your repository's .github/workflows folder.
Requests to the /api route are sent to your existing Azure Functions app.
Publish an Angular, React, Svelte, or Vue JavaScript app and API with Azure Static Web Apps and Azure Functions. Deploy your code from GitHub to a staging site using preview URLs.
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.