Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
331 stars 100 forks source link

UploadFile not working with FastAPI Integration #1333

Closed WaterKnight1998 closed 8 months ago

WaterKnight1998 commented 8 months ago

Afternoon,

We have an azure function using v2 and fastapi integration:

function_app.py

from typing import List
import logging
import azure.functions as func
import fastapi

fastapi_app = fastapi.FastAPI()
@fastapi_app.post("/api/asdf")
async def asdf(file: fastapi.UploadFile = fastapi.File(None)):
    logging.info(str(file))

app = func.AsgiFunctionApp(app=fastapi_app, http_auth_level=func.AuthLevel.ANONYMOUS)

The logging always print None, even I am posting file with file key.

WaterKnight1998 commented 8 months ago

Error in postman, local file didn't exist...