Configuration¶
LangGraphApp options¶
The LangGraphApp constructor accepts the following parameters:
auth_level¶
The Azure Functions authentication level for all registered routes.
import azure.functions as func
from azure_functions_langgraph import LangGraphApp
# Default: anonymous (no authentication required)
app = LangGraphApp()
# Require function key
app = LangGraphApp(auth_level=func.AuthLevel.FUNCTION)
# Require admin key
app = LangGraphApp(auth_level=func.AuthLevel.ADMIN)
Available levels:
| Level | Description |
|---|---|
ANONYMOUS |
No authentication (default) |
FUNCTION |
Requires a function-specific API key |
ADMIN |
Requires the master host key |
Graph registration¶
The register() method accepts:
| Parameter | Type | Required | Description |
|---|---|---|---|
graph |
Any (must satisfy InvocableGraph protocol) |
Yes | A compiled LangGraph graph or any object with an invoke() method |
name |
str |
Yes | Unique name used in URL routes (/api/graphs/{name}/invoke) |
description |
str or None |
No | Human-readable description shown in health endpoint |
app = LangGraphApp()
# Basic registration
app.register(graph=compiled_graph, name="my_agent")
# With description
app.register(
graph=compiled_graph,
name="my_agent",
description="Customer support agent with RAG",
)
Multiple graphs¶
You can register multiple graphs on a single LangGraphApp:
app = LangGraphApp()
app.register(graph=support_graph, name="support")
app.register(graph=sales_graph, name="sales")
app.register(graph=triage_graph, name="triage")
func_app = app.function_app
This creates endpoints for all three:
POST /api/graphs/support/invokePOST /api/graphs/support/streamPOST /api/graphs/sales/invokePOST /api/graphs/sales/streamPOST /api/graphs/triage/invokePOST /api/graphs/triage/streamGET /api/health
Checkpointer configuration¶
Checkpointers are configured on the LangGraph side, not in LangGraphApp. The library passes config through to the graph:
from langgraph.checkpoint.memory import InMemorySaver
checkpointer = InMemorySaver()
graph = builder.compile(checkpointer=checkpointer)
app = LangGraphApp()
app.register(graph=graph, name="stateful_agent")
Then pass thread_id in requests:
{
"input": {"messages": [{"role": "human", "content": "Hello"}]},
"config": {
"configurable": {"thread_id": "user-session-123"}
}
}
The health endpoint reports whether each graph has a checkpointer:
{
"status": "ok",
"graphs": [
{"name": "stateful_agent", "description": null, "has_checkpointer": true}
]
}
Azure Functions host configuration¶
The package works with the standard Azure Functions host.json:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[4.*, 5.0.0)"
}
}
No special configuration is required in host.json for this package.