# azure/azure-functions-python-library architecture

> Architecture diagram of the GitHub repository azure/azure-functions-python-library, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/azure-functions-python-library
- Repository: https://github.com/azure/azure-functions-python-library

## Overview

Azure Functions Python is a user-facing SDK for defining serverless functions and representing their triggers, bindings, and invocation data. The principal workflow is a developer registers a function and its trigger/bindings through the decorator API; the library exposes typed request, event, and message objects for function code and converts selected payloads to and from runtime data. The README lists the supported trigger and binding families, including custom bindings. The map also includes HTTP adapters, Durable Functions serialization, MCP support, and extension hooks. Relationships are limited to source-index references, excerpts, or README statements; unsampled wiring is not inferred.

Main entry points: [`azure/functions/meta.py`](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/meta.py) (Binding conversion), [`azure/functions/_http.py`](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http.py) (HTTP data model), [`azure/functions/_abc.py`](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_abc.py) (Abstract data contracts), [`azure/functions/decorators`](https://github.com/azure/azure-functions-python-library/tree/dev/azure/functions/decorators) (Trigger decorators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Function authoring"]
  node_function_app["Function app registration<br/>[function_app.py]"]
  node_decorator_core["Binding model<br/>[core.py]"]
  node_decorator_helpers["Decorator utilities<br/>[utils.py]"]
end

subgraph group_bindings["Triggers and bindings"]
  node_binding_decorators["Trigger decorators"]
  node_binding_models["Binding data APIs"]
  node_servicebus_model["Service Bus message<br/>[_servicebus.py]"]
  node_servicebus_data["Service Bus data<br/>[servicebus.py]"]
end

subgraph group_runtime["Invocation data"]
  node_http_api["HTTP request API<br/>[http.py]"]
  node_http_model["HTTP data model<br/>[_http.py]"]
  node_asgi_adapter["ASGI adapter<br/>[_http_asgi.py]"]
  node_wsgi_adapter["WSGI adapter<br/>[_http_wsgi.py]"]
  node_data_contracts["Abstract data contracts<br/>[_abc.py]"]
  node_metadata_conversion["Binding conversion<br/>[meta.py]"]
  node_json_support["JSON utilities<br/>[_jsonutils.py]"]
  node_serialization_helpers["Serialization helpers<br/>[_utils.py]"]
end

subgraph group_extensions["Extensions and protocols"]
  node_durable["Durable Functions"]
  node_mcp_api["MCP protocol API<br/>[mcp.py]"]
  node_mcp_decorators["MCP decorators<br/>[mcp.py]"]
  node_extension_registry["Extension registry<br/>[extension_meta.py]"]
  node_extension_hooks["Extension hooks"]
  node_extension_scope["Extension scope<br/>[extension_scope.py]"]
end

node_developer(("Function developer"))
node_functions_runtime(("Azure Functions runtime"))

node_developer -->|"defines functions"| node_function_app
node_function_app -->|"registers bindings"| node_binding_decorators
node_binding_decorators -->|"builds bindings"| node_decorator_core
node_decorator_core -->|"uses utilities"| node_decorator_helpers
node_binding_decorators -->|"declares capabilities"| node_binding_models
node_http_api -->|"uses model"| node_http_model
node_http_api -->|"implements contracts"| node_data_contracts
node_http_model -->|"implements contracts"| node_data_contracts
node_asgi_adapter -->|"adapts requests"| node_http_model
node_wsgi_adapter -->|"adapts requests"| node_http_model
node_metadata_conversion -->|"decodes JSON"| node_json_support
node_metadata_conversion -->|"uses helpers"| node_serialization_helpers
node_servicebus_data -->|"uses message model"| node_servicebus_model
node_servicebus_data -->|"converts payloads"| node_metadata_conversion
node_servicebus_model -->|"implements contract"| node_data_contracts
node_durable -->|"uses contracts"| node_data_contracts
node_mcp_decorators -->|"uses protocol API"| node_mcp_api
node_mcp_api -->|"encodes data"| node_metadata_conversion
node_extension_registry -->|"registers hooks"| node_extension_hooks
node_extension_registry -->|"checks scope"| node_extension_scope
node_functions_runtime -->|"indexes app"| node_function_app

click node_function_app "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/function_app.py"
click node_decorator_core "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/core.py"
click node_decorator_helpers "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/utils.py"
click node_binding_decorators "https://github.com/azure/azure-functions-python-library/tree/dev/azure/functions/decorators"
click node_binding_models "https://github.com/azure/azure-functions-python-library/tree/dev/azure/functions"
click node_http_api "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/http.py"
click node_http_model "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http.py"
click node_asgi_adapter "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http_asgi.py"
click node_wsgi_adapter "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http_wsgi.py"
click node_data_contracts "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_abc.py"
click node_metadata_conversion "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/meta.py"
click node_json_support "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_jsonutils.py"
click node_servicebus_model "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_servicebus.py"
click node_servicebus_data "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/servicebus.py"
click node_serialization_helpers "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_utils.py"
click node_durable "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_durable_functions.py"
click node_mcp_api "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/mcp.py"
click node_mcp_decorators "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/mcp.py"
click node_extension_registry "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/extension/extension_meta.py"
click node_extension_hooks "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/extension/app_extension_hooks.py"
click node_extension_scope "https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/extension/extension_scope.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_function_app,node_decorator_core,node_decorator_helpers toneBlue
class node_binding_decorators,node_binding_models,node_servicebus_model,node_servicebus_data toneAmber
class node_http_api,node_http_model,node_asgi_adapter,node_wsgi_adapter,node_data_contracts,node_metadata_conversion,node_json_support,node_serialization_helpers toneMint
class node_durable,node_mcp_api,node_mcp_decorators,node_extension_registry,node_extension_hooks,node_extension_scope toneRose
class node_developer,node_functions_runtime toneIndigo
```

## Components

### Function authoring

- [Function app registration](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/function_app.py): `azure/functions/decorators/function_app.py`
- [Binding model](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/core.py): `azure/functions/decorators/core.py`
- [Decorator utilities](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/utils.py): `azure/functions/decorators/utils.py`

### Triggers and bindings

- [Trigger decorators](https://github.com/azure/azure-functions-python-library/tree/dev/azure/functions/decorators): `azure/functions/decorators`
- [Binding data APIs](https://github.com/azure/azure-functions-python-library/tree/dev/azure/functions): `azure/functions`
- [Service Bus message](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_servicebus.py): `azure/functions/_servicebus.py`
- [Service Bus data](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/servicebus.py): `azure/functions/servicebus.py`

### Invocation data

- [HTTP request API](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/http.py): `azure/functions/http.py`
- [HTTP data model](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http.py): `azure/functions/_http.py`
- [ASGI adapter](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http_asgi.py): `azure/functions/_http_asgi.py`
- [WSGI adapter](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_http_wsgi.py): `azure/functions/_http_wsgi.py`
- [Abstract data contracts](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_abc.py): `azure/functions/_abc.py`
- [Binding conversion](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/meta.py): `azure/functions/meta.py`
- [JSON utilities](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_jsonutils.py): `azure/functions/_jsonutils.py`
- [Serialization helpers](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_utils.py): `azure/functions/_utils.py`

### Extensions and protocols

- [Durable Functions](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/_durable_functions.py): `azure/functions/_durable_functions.py`
- [MCP protocol API](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/mcp.py): `azure/functions/mcp.py`
- [MCP decorators](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/decorators/mcp.py): `azure/functions/decorators/mcp.py`
- [Extension registry](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/extension/extension_meta.py): `azure/functions/extension/extension_meta.py`
- [Extension hooks](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/extension/app_extension_hooks.py): `azure/functions/extension/app_extension_hooks.py`
- [Extension scope](https://github.com/azure/azure-functions-python-library/blob/dev/azure/functions/extension/extension_scope.py): `azure/functions/extension/extension_scope.py`

### Other components

- **Function developer**
- **Azure Functions runtime**

## Connections

- Function developer → Function app registration: defines functions
- Function app registration → Trigger decorators: registers bindings (evidence: `azure/functions/decorators/function_app.py`)
- Trigger decorators → Binding model: builds bindings (evidence: `azure/functions/decorators/servicebus.py`)
- Binding model → Decorator utilities: uses utilities (evidence: `azure/functions/decorators/core.py`)
- Trigger decorators → Binding data APIs: declares capabilities (evidence: `azure/functions/decorators/servicebus.py`)
- HTTP request API → HTTP data model: uses model (evidence: `azure/functions/http.py`)
- HTTP request API → Abstract data contracts: implements contracts (evidence: `azure/functions/http.py`)
- HTTP data model → Abstract data contracts: implements contracts (evidence: `azure/functions/_http.py`)
- ASGI adapter → HTTP data model: adapts requests (evidence: `azure/functions/_http_asgi.py`)
- WSGI adapter → HTTP data model: adapts requests (evidence: `azure/functions/_http_wsgi.py`)
- Binding conversion → JSON utilities: decodes JSON (evidence: `azure/functions/meta.py`)
- Binding conversion → Serialization helpers: uses helpers (evidence: `azure/functions/meta.py`)
- Service Bus data → Service Bus message: uses message model (evidence: `azure/functions/servicebus.py`)
- Service Bus data → Binding conversion: converts payloads (evidence: `azure/functions/servicebus.py`)
- Service Bus message → Abstract data contracts: implements contract (evidence: `azure/functions/_servicebus.py`)
- Durable Functions → Abstract data contracts: uses contracts (evidence: `azure/functions/_durable_functions.py`)
- MCP decorators → MCP protocol API: uses protocol API (evidence: `azure/functions/decorators/mcp.py`)
- MCP protocol API → Binding conversion: encodes data (evidence: `azure/functions/mcp.py`)
- Extension registry → Extension hooks: registers hooks (evidence: `azure/functions/extension/extension_meta.py`)
- Extension registry → Extension scope: checks scope (evidence: `azure/functions/extension/extension_meta.py`)
- Azure Functions runtime → Function app registration: indexes app (evidence: `azure/functions/decorators/function_app.py`)
