You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's set the following setting in Azure Functions host.json:
"extensions": {
"http": {
"routePrefix": ""
}
}
We get the following error after the Oryx build run by the Azure DevOps task AzureStaticWebApp@0:
Error in processing api build artifacts: the host.json file cannot specify a http.routePrefix value other than 'api'.
This would be fine, if it weren't for the fact that setting "routePrefix": "api" results in the following error when testing locally with swa start:
Microsoft.AspNetCore.Routing: An error occurred while creating the route with name 'http_app_func' and template 'api//{*route}'. Microsoft.AspNetCore.Routing: The route template separator character '/' cannot appear consecutively. It must be separated by either a parameter or a literal value. (Parameter 'routeTemplate'). Microsoft.AspNetCore.Routing: The route template separator character '/' cannot appear consecutively. It must be separated by either a parameter or a literal value.
The above error is shown locally, but the deployment completes on DevOps using AzureStaticWebApp@0, and the pipeline run was "successful". However, the API is not in fact deployed, likely because the function registration failed. There is no logging by the task which would indicate success or failure in finding functions to register. The task fails silently.
This happens specifically when using azure.functions.AsgiFunctionApp. I'm using it to (hopefully) deploy my FastAPI backend to my SWA resource.
Is this a known issue? Are there reasonable workarounds?
Describe the bug
Let's set the following setting in Azure Functions
host.json
:We get the following error after the Oryx build run by the Azure DevOps task
AzureStaticWebApp@0
:This would be fine, if it weren't for the fact that setting
"routePrefix": "api"
results in the following error when testing locally withswa start
:The above error is shown locally, but the deployment completes on DevOps using
AzureStaticWebApp@0
, and the pipeline run was "successful". However, the API is not in fact deployed, likely because the function registration failed. There is no logging by the task which would indicate success or failure in finding functions to register. The task fails silently.This happens specifically when using
azure.functions.AsgiFunctionApp
. I'm using it to (hopefully) deploy my FastAPI backend to my SWA resource.Is this a known issue? Are there reasonable workarounds?
This was brought up in Azure/azure-functions-python-worker#1310.
The text was updated successfully, but these errors were encountered: