FastAPI Runtime for Azure Functions Python Worker
Project description
Azure Functions FastAPI Runtime
This package provides a runtime adapter to run FastAPI applications natively in Azure Functions Python Worker.
Overview
The FastAPI runtime enables you to deploy existing FastAPI applications to Azure Functions without modifying your FastAPI code. The runtime:
- Discovers FastAPI routes in your application
- Converts each route to an Azure Function with HTTP trigger
- Handles request forwarding between Azure Functions and FastAPI
- Preserves FastAPI's request/response handling
Usage
Basic Example
Create a function_app.py with your FastAPI app:
from fastapi import FastAPI
app = FastAPI()
@app.get("/hello")
async def hello():
return {"message": "Hello from FastAPI on Azure Functions!"}
@app.post("/users")
async def create_user(name: str):
return {"user": name, "status": "created"}
The runtime will automatically discover these routes and create corresponding Azure Functions.
Architecture
- Indexer: Scans FastAPI app routes and generates function metadata
- Converter: Transforms FastAPI routes into Azure Functions structure
- Handler: Routes Azure Functions invocations to FastAPI
- Request/Response Adapter: Converts between Azure Functions and ASGI formats
Requirements
- Python 3.9+
- FastAPI 0.100.0+
- Azure Functions Python Worker
Installation
pip install azure-functions-fastapi-runtime
Development Status
This is currently a prototype/alpha release for testing FastAPI integration with Azure Functions.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file victorias_fastapi_test-0.4.0.tar.gz.
File metadata
- Download URL: victorias_fastapi_test-0.4.0.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0rc3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c35ddd2c1c5982688ea786ae036c926997bb2d5086bc5a7a370aa411c8d79572
|
|
| MD5 |
08008ae1e4320af99931dfcd85056c5b
|
|
| BLAKE2b-256 |
ae6ba27d255aa2ac1988e4262cf8ec6020bacc2ca92748e12b76e519c5273a4f
|
File details
Details for the file victorias_fastapi_test-0.4.0-py3-none-any.whl.
File metadata
- Download URL: victorias_fastapi_test-0.4.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0rc3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48ecfc8d70fb8a7d9931f705d94a3b94d6e1ca2eae4feafda97b97c7f28ba37f
|
|
| MD5 |
ecd1a43b0b8bc200ce5ce546a9237c66
|
|
| BLAKE2b-256 |
b3fb3a8e16569dcfa9ce495e3762a86e350c05cb64ad3764597e464cfac975d2
|