Skip to main content

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:

  1. Discovers FastAPI routes in your application
  2. Converts each route to an Azure Function with HTTP trigger
  3. Handles request forwarding between Azure Functions and FastAPI
  4. 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

victorias_fastapi_test-0.2.0.tar.gz (34.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

victorias_fastapi_test-0.2.0-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file victorias_fastapi_test-0.2.0.tar.gz.

File metadata

  • Download URL: victorias_fastapi_test-0.2.0.tar.gz
  • Upload date:
  • Size: 34.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0rc3

File hashes

Hashes for victorias_fastapi_test-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c1dd2073f85c2dc58186cfa839ae627ba05a5f7eaec340ff20f93a78990abf04
MD5 79fb09c9a99de4586a9b0a8ce3a08d4b
BLAKE2b-256 4e24c6eceb8cdaf6587105e0806cc5cf1c0f5b3cc3d3c30cf4c590555e2a1019

See more details on using hashes here.

File details

Details for the file victorias_fastapi_test-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for victorias_fastapi_test-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dc8dca488e1221b5be124aebfbce2d1422e5586c60475b46ee62b01a65f7bc39
MD5 41d27ef16a5704842350e1137967c6f2
BLAKE2b-256 2385dfb6eda94b9d3014c8b0f3fbadda72065991e813b5d816b34a02eda46ef7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page