C# and .NET examples · Azure Functions
Azure Durable Functions Examples in C#
Two runnable Azure Durable Functions v4 demos that demonstrate stateful, chained orchestration pipelines using the isolated worker model on .NET 8. Each demo starts an orchestration from an HTTP trigger, calls one or more activity functions in sequence (the function chaining pattern), and waits for the result before responding.
In this guide: Get started · Walk through the example · Understand the details · Check the limits
✨ Features
Projects
| Project | Port | Pipeline |
|---|---|---|
| DemoOne | 7239 | HTTP → Orchestrator → 1 activity (greeting) |
| DemoTwo | 7176 | HTTP → Orchestrator → 3 activities (validate → process → greet) |
🚀 Quick start
Quick Start
From the repository root, use a separate terminal for each command group:
# Run DemoOne
cd Durable/DemoOne
func start --port 7239
# Run DemoTwo (in a separate terminal)
cd Durable/DemoTwo
func start --port 7176
See each project’s own readme — DemoOne and DemoTwo — for detailed usage and endpoint examples.
Known issue in DemoTwo: its HTTP starter currently returns
400 Bad Requestafter a completed orchestration reaches its output check, including valid names. See DemoTwo’s known issue for the cause and a fix.
📦 Prerequisites and installation
Requirements
- .NET 8 SDK
- Azure Functions Core Tools v4
- Azurite (local storage emulator) or an Azure Storage account
Shared NuGet Packages
Both projects use the same package versions:
| Package | Version |
|---|---|
Microsoft.Azure.Functions.Worker |
2.0.0 |
Microsoft.Azure.Functions.Worker.Extensions.DurableTask |
1.2.3 |
Microsoft.Azure.Functions.Worker.Extensions.Http |
3.3.0 |
Microsoft.Azure.Functions.Worker.Extensions.Http.AspNetCore |
2.0.1 |
Microsoft.Azure.Functions.Worker.Sdk |
2.0.2 |
⚙️ Configuration
Minimum local.settings.json
Each project requires its own local.settings.json (not committed to source control):
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
}
}
💡 Usage
What Are Durable Functions?
Azure Durable Functions is an extension of Azure Functions that lets you write stateful workflows in a serverless environment. Orchestrator functions define the workflow logic and call activity functions, while the Durable Task Framework manages orchestration state and checkpoints. These samples do not configure activity retry policies.
🧪 Development and testing
Build DemoOne and DemoTwo separately, then start each host with its own local settings and storage. Check a normal name, an empty body and malformed JSON; inspect orchestration status as well as the HTTP response. No Functions host or storage emulator was launched in this review.
🛠️ Troubleshooting and limitations
Both starters wait for completion without an explicit timeout or cancellation token. Activity retries are not configured in these samples. Local storage settings must be created separately for each project, with Azurite running when using the development connection string.
🔗 Related documentation
Related Examples
- Azure Functions middleware (.NET 6 and .NET 8)
- Keyed dependency injection in Azure Functions
- MediatR and CQRS in Azure Functions
- Back to all C# and .NET code examples
Documentation links
Read all C# and .NET Code Examples guides online · Project overview · All developer projects