Skip to content

Commit 1cba28c

Browse files
committed
Update function configuration
1 parent fed3c9d commit 1cba28c

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

code/function/function_app.py renamed to code/function/main.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import azure.functions as func
1+
# import azure.functions as func
22
from fastapi import FastAPI
33
from function.api.v1.api_v1 import api_v1_router
44
from function.core.config import settings
@@ -28,11 +28,11 @@ async def shutdown_event():
2828
pass
2929

3030

31-
app = func.AsgiFunctionApp(
32-
app=fastapi_app,
33-
http_auth_level=func.AuthLevel.ANONYMOUS,
34-
)
31+
# app = func.AsgiFunctionApp(
32+
# app=fastapi_app,
33+
# http_auth_level=func.AuthLevel.ANONYMOUS,
34+
# )
3535

3636

37-
async def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
38-
return await func.AsgiMiddleware(fastapi_app).handle_async(req, context)
37+
# async def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
38+
# return await func.AsgiMiddleware(fastapi_app).handle_async(req, context)

code/function/wrapper/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import azure.functions as func
2+
from function.main import fastapi_app
3+
4+
5+
async def main(req: func.HttpRequest, context: func.Context) -> func.HttpResponse:
6+
return await func.AsgiMiddleware(fastapi_app).handle_async(req, context)

code/function/function.json renamed to code/function/wrapper/function.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"scriptFile": "function_app.py",
2+
"scriptFile": "__init__.py",
33
"bindings": [
44
{
55
"authLevel": "anonymous",

0 commit comments

Comments
 (0)