Durable Functions (an extension of Azure Functions and Azure WebJobs) enables writing long-running, stateful function orchestrations in code in a serverless environment (PaaS options and self-hosting are also supported).
This extension enables a new type of function called the orchestrator function that allows you to do several new things that differentiates it from an ordinary, stateless function:
- They are stateful workflows authored in code. No JSON schemas or designers.
- They can synchronously and asynchronously call other functions and save output to local variables.
- They automatically checkpoint their progress whenever the function awaits so that local state is never lost if the process recycles or the VM reboots.
The Durable Functions extension currently ships as the Microsoft.Azure.WebJobs.Extensions.DurableTask NuGet package that can be referenced by an Azure Functions Visual Studio project.
Are you new to Durable Functions? If so, this is the place to start.
Samples / Walkthroughs
Here are some samples you can study and/or reference. These will help you 1) learn how to write Durable Functions by example and 2) learn the various capabilities of Durable Functions.
- Function Chaining - Hello sequence
- Fan-out/Fan-in - Cloud backup
- Monitors - Weather watcher
- Human interaction & timeouts - Phone verification
- Unit testing - xUnit & Moq
- Self hosting - WebJob SDK integration
- Lifecycle event notifications - Azure Event Grid
Using one of the sample projects is a great way to get up and running quickly and is the recommended way to get started. See the sample / walkthrough links above for specific instructions.
Or if you prefer to start diving into the sample code, there are samples available for several development platforms:
- C# for Visual Studio, including unit test samples
- C# scripts
- C# for Azure WebJobs
Here you will find comprehensive documentation with examples on all of the feature areas. It's highly recommended that you read through all of these topics before coding.
- Checkpointing & replay
- Custom orchestration status
- Instance management
- HTTP APIs
- Error handling & compensation
- Durable timers
- External events
- Eternal orchestrations
- Singleton orchestrations
- Task hubs
- Performance & scale
- Disaster recovery and geo-distribution
.NET APIs / Bindings
We welcome outside contributions. If you are interested in contributing, please take a look at our CONTRIBUTING guide.