Skip to content

Commit 5ec7940

Browse files
author
ks6088ts
committed
add Azure Functions
1 parent 4fe6796 commit 5ec7940

File tree

7 files changed

+60
-0
lines changed

7 files changed

+60
-0
lines changed

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,7 @@ dev: ## run FastAPI server in development mode
120120
--host 0.0.0.0 \
121121
--port 8000 \
122122
--reload
123+
124+
.PHONY: azure-functions
125+
azure-functions: ## run Azure Functions server
126+
uv run func start

docs/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
## FastAPI
44

55
- [FastAPI](https://fastapi.tiangolo.com/)
6+
7+
## Azure Functions
8+
9+
- [Using FastAPI Framework with Azure Functions](https://learn.microsoft.com/en-us/samples/azure-samples/fastapi-on-azure-functions/fastapi-on-azure-functions/)
10+
- [ks6088ts-labs/azure-functions-python](https://github.com/ks6088ts-labs/azure-functions-python)

function_app.py

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

host.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"version": "2.0",
3+
"extensions": {
4+
"http": {
5+
"routePrefix": ""
6+
}
7+
}
8+
}

local.settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"IsEncrypted": false,
3+
"Values": {
4+
"FUNCTIONS_WORKER_RUNTIME": "python",
5+
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
6+
"AzureWebJobsStorage": ""
7+
}
8+
}

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "A GitHub template repository for Python"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8+
"azure-functions>=1.23.0",
89
"fastapi[standard]>=0.115.12",
910
]
1011

uv.lock

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)