Hello @Mikhail Smal !
Welcome to Microsoft QnA!
Have you gone through this link :
https://learn.microsoft.com/en-us/azure/static-web-apps/apis-overview &
https://learn.microsoft.com/en-us/azure/static-web-apps/apis-container-apps
If you read the details :
"Both URLs point to the same API endpoint. The endpoint on the container app must have the /api
prefix, since Static Web Apps matches requests made to /api
and proxies the entire path to the linked resource. "
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 /api
route available to the front-end web app without requiring custom CORS rules.
API options
The following Azure services can be integrated with Azure Static Web 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.
Note
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.
API constraints
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
/api
.
- 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.
- Network isolated backends are not supported.
The following constraints apply to Bring your own API backends:
- An application must be deployed to your static web app before requests to the
/api
route can be resolved.
- Bring your own API backends cannot be linked to a Static Web Apps pull request environment.
Because we dont have much details about your deployement i can offer these instructions
If you could post more details we can provide more help
In case this answer helped kindly mark it as Accepted and Upvote , or post your details of the implementation
I hope this helps!
Kindly mark the answer as Accepted and Upvote in case it helped!
Regards