ref. Azure Functions + WSGI + Flask sample WSGI + Flask version.
.
├── fastapi_app # FastAPI/ASGI WebApp
│ ├── __init__.py
│ └── app.py
├── functions_asgi # Functions entry -> ASGI
│ ├── __init__.py
│ └── function.json
├── host.json
└── requirements.txt
import azure.functions as func
from fastapi_app.app import app # app = FastAPI()
def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
# ASGI Application
return func.AsgiMiddleware(app).handle(req, context)
# ^^^^^^^^^^^^^^ ^^^