LangGraph integration for Azure Functions Python v2 — deploy compiled graphs as HTTP endpoints
Project description
Azure Functions LangGraph
Read this in: 한국어 | 日本語 | 简体中文
Beta Notice — This package is under active development (
0.4.0). Core APIs are stabilizing but may still change between minor releases. Please report issues on GitHub.
Deploy LangGraph graphs as Azure Functions HTTP endpoints with minimal boilerplate.
Part of the Azure Functions Python DX Toolkit
Why this exists
Deploying LangGraph on Azure Functions is harder than it should be.
- LangGraph does not provide an Azure Functions-native deployment adapter
- Exposing compiled graphs as HTTP endpoints requires repetitive wiring
- Teams often rebuild the same invoke/stream wrapper for every project
This package provides a focused adapter for serving LangGraph graphs on Azure Functions Python v2.
What it does
- Zero-boilerplate deployment — register a compiled graph, get HTTP endpoints automatically
- Invoke endpoint —
POST /api/graphs/{name}/invokefor synchronous execution - Stream endpoint —
POST /api/graphs/{name}/streamfor buffered SSE responses - Health endpoint —
GET /api/healthlisting registered graphs with checkpointer status - Checkpointer pass-through — thread-based conversation state works via LangGraph's native config
- State endpoint —
GET /api/graphs/{name}/threads/{thread_id}/statefor thread state inspection (when supported) - Per-graph auth — override app-level auth with
register(..., auth_level=...) - LangGraph Platform API compatibility — SDK-compatible endpoints for threads, runs, assistants, and state (v0.3+)
- Persistent storage backends — Azure Blob Storage checkpointer and Azure Table Storage thread store (v0.4+)
LangGraph Platform comparison
| Feature | LangGraph Platform | azure-functions-langgraph |
|---|---|---|
| Hosting | LangChain Cloud (paid) | Your Azure subscription |
| Assistants | Built-in | SDK-compatible API (v0.3+) |
| Thread lifecycle | Built-in | Create, get, update, delete, search, count (v0.3+) |
| Runs | Built-in | Threaded + threadless runs (v0.4+) |
| State read/update | Built-in | get_state + update_state (v0.4+) |
| State history | Built-in | Checkpoint history with filtering (v0.4+) |
| Streaming | True SSE | Buffered SSE |
| Persistent storage | Built-in | Azure Blob + Table Storage (v0.4+) |
| Infrastructure | Managed | Azure Functions (serverless) |
| Cost model | Per-seat/usage | Azure Functions pricing |
Scope
- Azure Functions Python v2 programming model
- LangGraph graph deployment and HTTP exposure
- LangGraph runtime concerns: invoke, stream, threads, runs, and state
- Optional integration points for validation and OpenAPI via companion packages
This package is a deployment adapter — it wraps LangGraph, it does not replace it.
Internally, graph registration remains protocol-based (
LangGraphLike), so any object satisfying the protocol works — but the package's documentation and examples focus on LangGraph use cases.
What this package does not do
This package does not own:
- OpenAPI document generation or Swagger UI — use
azure-functions-openapi - Request/response validation beyond LangGraph contracts — use
azure-functions-validation - Generic graph-serving abstractions beyond LangGraph
Note: For OpenAPI spec generation, use the
azure-functions-openapipackage with the bridge module (azure_functions_langgraph.openapi.register_with_openapi).
Installation
pip install azure-functions-langgraph
For persistent storage with Azure services:
# Azure Blob Storage checkpointer
pip install azure-functions-langgraph[azure-blob]
# Azure Table Storage thread store
pip install azure-functions-langgraph[azure-table]
# Both
pip install azure-functions-langgraph[azure-blob,azure-table]
Your Azure Functions app should also include:
azure-functions
langgraph
azure-functions-langgraph
For local development:
git clone https://github.com/yeongseon/azure-functions-langgraph.git
cd azure-functions-langgraph
pip install -e .[dev]
Quick Start
from langgraph.graph import END, START, StateGraph
from typing_extensions import TypedDict
import azure.functions as func
from azure_functions_langgraph import LangGraphApp
# 1. Define your state
class AgentState(TypedDict):
messages: list[dict[str, str]]
# 2. Define your nodes
def chat(state: AgentState) -> dict:
user_msg = state["messages"][-1]["content"]
return {"messages": state["messages"] + [{"role": "assistant", "content": f"Echo: {user_msg}"}]}
# 3. Build graph
builder = StateGraph(AgentState)
builder.add_node("chat", chat)
builder.add_edge(START, "chat")
builder.add_edge("chat", END)
graph = builder.compile()
# 4. Deploy (ANONYMOUS for local dev; use FUNCTION in production — see below)
app = LangGraphApp(auth_level=func.AuthLevel.ANONYMOUS)
app.register(graph=graph, name="echo_agent")
func_app = app.function_app # ← use this as your Azure Functions app
Start the Functions host locally:
func start
Verify locally and on Azure
After deploying (see docs/deployment.md), the same request produces the same response in both environments. Azure requires a function key (?code=<FUNCTION_KEY>) when auth_level is set to FUNCTION.
Local
curl -s http://localhost:7071/api/health
{"status": "ok", "graphs": [{"name": "echo_agent", "description": null, "has_checkpointer": false}]}
Azure
curl -s "https://<your-app>.azurewebsites.net/api/health?code=<FUNCTION_KEY>"
{"status": "ok", "graphs": [{"name": "echo_agent", "description": null, "has_checkpointer": false}]}
Response format verified against a temporary Azure Functions deployment of the
simple_agentexample in koreacentral (Python 3.12, Consumption plan). The Quick Start usesecho_agentfor illustration; the health endpoint returns the same JSON structure regardless of graph name. URL anonymized.
Production authentication
Important:
LangGraphAppdefaults toAuthLevel.ANONYMOUSfor local development convenience. This default will change toAuthLevel.FUNCTIONin v1.0. For production deployments, always setauth_levelexplicitly:
import azure.functions as func
from azure_functions_langgraph import LangGraphApp
# Production: require function key authentication
app = LangGraphApp(auth_level=func.AuthLevel.FUNCTION)
Per-graph auth
Override app-level auth settings per graph:
# Per-graph authentication override
app.register(graph=public_graph, name="public", auth_level=func.AuthLevel.ANONYMOUS)
app.register(graph=private_graph, name="private", auth_level=func.AuthLevel.FUNCTION)
Example request using a function key:
curl -X POST "https://<app>.azurewebsites.net/api/graphs/echo_agent/invoke?code=<FUNCTION_KEY>" \
-H "Content-Type: application/json" \
-d '{"input": {"messages": [{"role": "human", "content": "Hello!"}]}}'
What you get
POST /api/graphs/echo_agent/invoke— invoke the agentPOST /api/graphs/echo_agent/stream— stream agent responses (buffered SSE)GET /api/graphs/echo_agent/threads/{thread_id}/state— inspect thread stateGET /api/health— health check
With platform_compat=True, you also get SDK-compatible endpoints:
POST /assistants/search— list registered assistantsGET /assistants/{id}— get assistant detailsPOST /assistants/count— count assistantsPOST /threads— create threadGET /threads/{id}— get threadPATCH /threads/{id}— update thread metadataDELETE /threads/{id}— delete threadPOST /threads/search— search threadsPOST /threads/count— count threadsPOST /threads/{id}/runs/wait— run and wait for resultPOST /threads/{id}/runs/stream— run and stream resultPOST /runs/wait— threadless runPOST /runs/stream— threadless streamGET /threads/{id}/state— get thread statePOST /threads/{id}/state— update thread statePOST /threads/{id}/history— get state history
Request format
{
"input": {
"messages": [{"role": "human", "content": "Hello!"}]
},
"config": {
"configurable": {"thread_id": "conversation-1"}
}
}
Persistent storage (v0.4+)
Use Azure Blob Storage for checkpoint persistence and Azure Table Storage for thread metadata:
import azure.functions as func
from azure.storage.blob import ContainerClient
from langgraph.graph import END, START, StateGraph
from typing_extensions import TypedDict
from azure_functions_langgraph import LangGraphApp
from azure_functions_langgraph.checkpointers.azure_blob import AzureBlobCheckpointSaver
from azure_functions_langgraph.stores.azure_table import AzureTableThreadStore
class AgentState(TypedDict):
messages: list[dict[str, str]]
def chat(state: AgentState) -> dict:
user_msg = state["messages"][-1]["content"]
return {"messages": state["messages"] + [{"role": "assistant", "content": f"Echo: {user_msg}"}]}
# Build graph with Azure Blob checkpointer
container_client = ContainerClient.from_connection_string(
"DefaultEndpointsProtocol=https;AccountName=...", "checkpoints"
)
saver = AzureBlobCheckpointSaver(container_client=container_client)
builder = StateGraph(AgentState)
builder.add_node("chat", chat)
builder.add_edge(START, "chat")
builder.add_edge("chat", END)
graph = builder.compile(checkpointer=saver)
# Deploy with Azure Table thread store
thread_store = AzureTableThreadStore.from_connection_string(
"DefaultEndpointsProtocol=https;AccountName=...", table_name="threads"
)
# Production: always set auth_level explicitly
app = LangGraphApp(platform_compat=True, auth_level=func.AuthLevel.FUNCTION)
app.thread_store = thread_store
app.register(graph=graph, name="echo_agent")
func_app = app.function_app
Checkpoints and thread metadata survive Azure Functions restarts and scale across instances.
Upgrading
v0.3.0 → v0.4.0
Fully backward-compatible. No breaking changes.
- New optional extras:
pip install azure-functions-langgraph[azure-blob,azure-table]for persistent storage - New platform endpoints: thread CRUD, state update/history, threadless runs, assistants count
- New protocols:
UpdatableStateGraph,StateHistoryGraph(available fromazure_functions_langgraph.protocols)
v0.4.0 → v0.5.0
Fully backward-compatible. No breaking changes.
- Metadata API:
app.metadata()returns an immutable snapshot of all registered routes and graph info - OpenAPI bridge:
azure_functions_langgraph.openapi.register_with_openapiintegrates withazure-functions-openapi - CloneableGraph protocol: thread-isolated graph cloning for safe concurrent execution
When to use
- You have LangGraph agents and want to deploy them on Azure Functions
- You want serverless deployment without LangGraph Platform costs
- You need HTTP endpoints for your compiled graphs with minimal setup
- You want thread-based conversation state via LangGraph checkpointers
- You need durable state persistence with Azure Blob/Table Storage
Documentation
- Project docs live under
docs/ - Smoke-tested examples live under
examples/ - Product requirements:
PRD.md - Design principles:
DESIGN.md
Ecosystem
This package is part of the Azure Functions Python DX Toolkit.
Design principle: azure-functions-langgraph owns LangGraph runtime exposure. azure-functions-validation owns validation. azure-functions-openapi owns API documentation.
| Package | Role |
|---|---|
| azure-functions-langgraph | LangGraph deployment adapter for Azure Functions |
| azure-functions-validation | Request/response validation and serialization |
| azure-functions-openapi | OpenAPI spec generation and Swagger UI |
| azure-functions-logging | Structured logging and observability |
| azure-functions-doctor | Pre-deploy diagnostic CLI |
| azure-functions-scaffold | Project scaffolding |
| azure-functions-durable-graph | Manifest-first graph runtime with Durable Functions |
| azure-functions-python-cookbook | Recipes and examples |
Disclaimer
This project is an independent community project and is not affiliated with, endorsed by, or maintained by Microsoft or LangChain.
Azure and Azure Functions are trademarks of Microsoft Corporation. LangGraph and LangChain are trademarks of LangChain, Inc.
License
MIT
Project details
Release history Release notifications | RSS feed
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 azure_functions_langgraph-0.5.0.tar.gz.
File metadata
- Download URL: azure_functions_langgraph-0.5.0.tar.gz
- Upload date:
- Size: 163.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5deca88c5c6c07a1f3239d3142c7fe8357ea2367b97e00635f885f9c8342867c
|
|
| MD5 |
bab093d02a9c27c7df432d39af4447d7
|
|
| BLAKE2b-256 |
80c5113cd53ff154606ed512bb8bc7f6069dbe30765cc6d7de4608c79db458ad
|
Provenance
The following attestation bundles were made for azure_functions_langgraph-0.5.0.tar.gz:
Publisher:
publish-pypi.yml on yeongseon/azure-functions-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
azure_functions_langgraph-0.5.0.tar.gz -
Subject digest:
5deca88c5c6c07a1f3239d3142c7fe8357ea2367b97e00635f885f9c8342867c - Sigstore transparency entry: 1243602401
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-langgraph@a297aa0f2303f375c831ea14ec0ff3e4e536d032 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a297aa0f2303f375c831ea14ec0ff3e4e536d032 -
Trigger Event:
push
-
Statement type:
File details
Details for the file azure_functions_langgraph-0.5.0-py3-none-any.whl.
File metadata
- Download URL: azure_functions_langgraph-0.5.0-py3-none-any.whl
- Upload date:
- Size: 46.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d8c34ad597fa76147fac006ee1073d94123ad3e86f83300f5cc4b643d261ec0
|
|
| MD5 |
0587d6c31768395eb08b459ca03b36ed
|
|
| BLAKE2b-256 |
528be8b7f7de20bf6ff000aa77a47ec5ec79f3c973279c468ffcb133afaa20c0
|
Provenance
The following attestation bundles were made for azure_functions_langgraph-0.5.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on yeongseon/azure-functions-langgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
azure_functions_langgraph-0.5.0-py3-none-any.whl -
Subject digest:
2d8c34ad597fa76147fac006ee1073d94123ad3e86f83300f5cc4b643d261ec0 - Sigstore transparency entry: 1243602403
- Sigstore integration time:
-
Permalink:
yeongseon/azure-functions-langgraph@a297aa0f2303f375c831ea14ec0ff3e4e536d032 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/yeongseon
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@a297aa0f2303f375c831ea14ec0ff3e4e536d032 -
Trigger Event:
push
-
Statement type: