API support in Azure Static Web Apps with Azure Functions | Microsoft Docs
source link: https://docs.microsoft.com/en-us/azure/static-web-apps/apis?WT_mc_id=-blog-scottha
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
API support in Azure Static Web Apps Preview with Azure Functions
- 05/08/2020
- 2 minutes to read
In this article
Azure Static Web Apps provides serverless API endpoints via Azure Functions. By leveraging Azure Functions, APIs dynamically scale based on demand, and include the following features:
- Integrated security with direct access to user authentication and role-based authorization data.
- Seamless routing that makes the api route available to the web app securely without requiring custom CORS rules.
- Azure Functions v3 compatible with Node.js 12, .NET Core 3.1, and Python 3.8.
- HTTP triggers and input/output bindings.
Configuration
API endpoints are available to the web app through the api route. While this route is fixed, you have control over the folder and project where you locate the associated Azure Functions app. You can change this location by editing the workflow YAML file located in your repository's .github/workflows folder.
Constraints
Azure Static Web Apps provides an API through Azure Functions. The capabilities of Azure Functions are focused to a specific set of features that enable you to create an API for a web app and allow the web app to connect to API securely. These features come with some constraints, including:
- The API route prefix must be api.
- The API must either be a JavaScript, C#, or Python Azure Functions app.
- Route rules for API functions only support redirects and securing routes with roles.
- Triggers are limited to HTTP.
- Input and output bindings are supported.
- Logs are only available if you add Application Insights to your Functions app.
Next steps
Is this page helpful?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK