Skip to content

Commit efbb0dc

Browse files
authored
Merge branch 'main' into dependabot/pip/fastapi-0.99.1
2 parents 9c75949 + eaeef9d commit efbb0dc

File tree

8 files changed

+10
-34
lines changed

8 files changed

+10
-34
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"build": {
44
"dockerfile": "Dockerfile",
55
"args": {
6-
"IMAGE": "python:3.10"
6+
"IMAGE": "python:3.10-bullseye"
77
},
88
"context": ".."
99
},

.vscode/tasks.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
"label": "func: host start",
77
"command": "host start --python",
88
"problemMatcher": "$func-python-watch",
9-
"isBackground": true,
10-
"options": {
11-
"env": {
12-
"PYTHON_ISOLATE_WORKER_DEPENDENCIES": "1"
13-
}
14-
}
9+
"isBackground": true
1510
}
1611
]
1712
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Use the local emulator from Azure Functions Core Tools to test the function loca
3939

4040
1. Open this repository in Github Codespaces or VS Code with Remote Dev Containers extension.
4141
2. Open the Terminal and make sure you're in the root folder.
42-
3. Run `PYTHON_ISOLATE_WORKER_DEPENDENCIES=1 func host start --python`
42+
3. Run `func host start --python`
4343
4. Click 'http://localhost:7071/{*route}' in the terminal, which should open a website in a new tab. Change the URL to "/" to see the auto-generated documentation and try generating a map.
4444
4545
## Deployment

function/__init__.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22

3-
import azure.functions
43
from azure.monitor.opentelemetry.exporter import AzureMonitorTraceExporter
54
from opentelemetry.instrumentation.fastapi import FastAPIInstrumentor
65
from opentelemetry.sdk.resources import SERVICE_NAME, Resource
@@ -19,7 +18,3 @@ async def startup_event():
1918
tracer = TracerProvider(resource=Resource({SERVICE_NAME: "api"}))
2019
tracer.add_span_processor(BatchSpanProcessor(exporter))
2120
FastAPIInstrumentor.instrument_app(fastapi_app, tracer_provider=tracer)
22-
23-
24-
async def main(req: azure.functions.HttpRequest, context: azure.functions.Context) -> azure.functions.HttpResponse:
25-
return await azure.functions.AsgiMiddleware(fastapi_app).handle_async(req, context)

function/function.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

function_app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import azure.functions as func
2+
3+
from function import fastapi_app
4+
5+
app = func.AsgiFunctionApp(app=fastapi_app, http_auth_level=func.AuthLevel.FUNCTION)

infra/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ module functionApp 'core/host/functions.bicep' = {
7070
tags: union(tags, { 'azd-service-name': 'api' })
7171
alwaysOn: false
7272
appSettings: {
73-
PYTHON_ISOLATE_WORKER_DEPENDENCIES: 1
73+
AzureWebJobsFeatureFlags: 'EnableWorkerIndexing'
7474
}
7575
applicationInsightsName: monitoring.outputs.applicationInsightsName
7676
appServicePlanId: appServicePlan.outputs.id

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
azure-functions>=1.12.0
66
py-staticmaps==0.4.0
77
fastapi==0.99.1
8+
Pillow==9.5.0
89
nest-asyncio==1.5.6
910
opentelemetry-instrumentation-fastapi==0.39b0
1011
azure-monitor-opentelemetry-exporter==1.0.0b14

0 commit comments

Comments
 (0)