How to use input and output bindings on Azure function app, python programming model v2 and using ASGI Web framework?

Jan Kowalik 100 Reputation points
2024-04-30T07:22:22.4033333+00:00

How to use input and output bindings on Azure function app that is written using python programming model v2 and an ASGI Web framework - FastAPI?
How do I add bindings (input and output) to endpoints defined like the below? Is it possible? How would you add a binding to that GET handler? e.g. blob storage output binding

import azure.functions as func 
from fastapi import FastAPI, Request, Response

fast_app = FastAPI()

@fast_app.get("/return_http_no_body") 
async def return_http_no_body(): 
    return Response(content="", media_type="text/plain")

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


Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,350 questions
{count} votes