How azure/azure-functions-durable-extension works
Project type and purpose
• This is an open-source extension library (“Durable Functions”) for the Azure Functions platform.
• Its purpose is to add stateful workflow primitives (orchestrators, activities, entities) into the Azure Functions host by providing bindings, listeners, context implementations, storage providers, HTTP/GRPC APIs, and compile-time analyzers/source generators.
File structure
• src/WebJobs.Extensions.DurableTask – the core runtime library loaded into the Functions host
– Bindings: ActivityTrigger, OrchestrationTrigger, EntityTrigger
– ContextImplementations: DurableOrchestrationContext, DurableActivityContext, DurableEntityContext, DurableClient
– Listener: DurableTaskListener, GRPC listener for out-of-proc scenarios
– Storage: Azure Storage / Queue / Table / Blob providers for histories, messages, payloads
– HTTP: HTTP API handler for management endpoints
– Correlation & Telemetry helpers
• src/Worker.Extensions.DurableTask – the .NET Functions Worker (isolated process) integration
• src/WebJobs.Extensions.DurableTask.Analyzers – Roslyn analyzers and code-fix providers for C# functions
• src/DurableFunctions.TypedInterfaces – a source-generator that emits strongly-typed Durable Function client and activity callers at compile time
• test & samples – a large suite of unit, smoke, E2E, performance tests and sample projects demonstrating usage
• docfx & docs – documentation site generator and built API reference
README for additional insights
• Confirms the extension model: it plugs into Azure Functions to enable orchestrator, activity, and entity functions
• References the core NuGet packages and supported languages
Main components
a. Azure Functions Host
– The “WebJobs Host” or “Functions Worker” which loads extensions at startup.
b. Durable Functions Extension (your code under src/)
– Bindings registration
– Listeners (polling storage, handling GRPC for out-of-proc)
– Context implementations (in-proc and out-of-proc)
– Storage providers (Queue, Table, Blob)
– HTTP Management API
– Telemetry & Correlation
c. Developer’s Function Code
– Orchestrator functions
– Activity functions
– Entity functions
d. Azure Storage Services
– Queues: orchestration messages
– Tables: status & history
– Blobs: large payloads
e. HTTP / GRPC Client
– Client code calling StartNewAsync, RaiseEvent, QueryStatus (via HTTP or language SDK)
f. Compile-time toolchain
– Roslyn Analyzers for C# rules
– Source Generator for typed interfaces
Relationships and interactions
• At startup, Functions Host → invokes DurableTaskWebJobsStartup → registers binding providers & listeners
• Developer’s code decorated with [OrchestrationTrigger], [ActivityTrigger], [EntityTrigger]
• Host listens on Storage Queues or gRPC ports → dispatches to orchestrator/activity/entity contexts
• Context implementations enqueue messages into storage (Queues/Tables/Blobs) and manage state transitions
• HTTP Management API sits on top of Functions Host → exposes REST endpoints for client control
• Telemetry & correlation modules hook into ActivitySource/ILogger → push to Application Insights
• During build, source generator runs → emits typed callers; analyzers validate attribute usage
Architectural patterns & design principles
• Extension-based plugin model (Functions extensibility)
• Publisher-subscriber messaging via storage queues
• Stateful workflows implemented as deterministic event-sourced orchestrators
• Out-of-proc isolation via gRPC bridging
• Dependency Injection and options pattern for configuration
• Compile-time code generation (source generators) and static analysis
Essential elements to capture
• The Functions Host extension hook
• Storage-based messaging backbone
• Context implementations bridging host and storage
• HTTP Management API layer
• Out-of-proc gRPC channel for isolated worker
• Compile-time Roslyn pipeline (analyzers, source generator)