Durable Task Scheduler

January 23, 2026 · View on GitHub

The Durable Task Scheduler is a fully managed Azure service purpose-built for running durable orchestrations. It provides the best experience for production workloads with zero infrastructure management and built-in enterprise support.

Recommended: For new projects, we recommend the Durable Task Scheduler as your backend provider.

Overview

FeatureBenefit
Fully ManagedNo storage accounts, databases, or infrastructure to manage
Built-in DashboardMonitor orchestrations without additional tooling
Highest ThroughputPurpose-built for durable workflow performance
Azure Support24/7 enterprise support with SLA (with Azure support plan)
Managed IdentitySecure authentication using Azure AD
Local EmulatorDocker-based emulator for development

For complete documentation on creating and configuring Azure resources, authentication, SKUs, RBAC, and pricing, see the official Azure documentation.

Installation

dotnet add package Microsoft.DurableTask.AzureManagedBackend

DTFx Code Sample

using DurableTask.Core;
using Microsoft.DurableTask.AzureManagedBackend;
using Microsoft.Extensions.Logging;

// Get connection string from environment
// Expected format: "Endpoint=https://<host>;Authentication=<credentialType>;TaskHub=<hubName>"
string? connectionString = Environment.GetEnvironmentVariable("DTS_CONNECTION_STRING");
if (string.IsNullOrWhiteSpace(connectionString))
{
    Console.Error.WriteLine("An environment variable named DTS_CONNECTION_STRING is required.");
    return;
}

// Configure logging
ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
    builder.AddSimpleConsole(options =>
    {
        options.SingleLine = true;
        options.UseUtcTimestamp = true;
        options.TimestampFormat = "yyyy-MM-ddTHH:mm:ss.fffZ ";
    }));

// Create the orchestration service for Durable Task Scheduler
AzureManagedOrchestrationService service = new(
    AzureManagedOrchestrationServiceOptions.FromConnectionString(connectionString),
    loggerFactory);

// Create and configure the worker
TaskHubWorker worker = new(service, loggerFactory);
worker.AddTaskOrchestrations(typeof(HelloWorldOrchestration));
worker.AddTaskActivities(typeof(HelloActivity));

// Start the worker
await worker.StartAsync();

// Create a client and start an orchestration
TaskHubClient client = new(service, null, loggerFactory);
OrchestrationInstance instance = await client.CreateOrchestrationInstanceAsync(
    orchestrationType: typeof(HelloWorldOrchestration),
    input: null);

Console.WriteLine($"Started orchestration with ID = '{instance.InstanceId}'");

// Wait for completion
OrchestrationState state = await client.WaitForOrchestrationAsync(
    instance, 
    TimeSpan.FromMinutes(1));

Console.WriteLine($"Orchestration completed with status: {state.OrchestrationStatus}");
Console.WriteLine($"Output: {state.Output}");

// Clean up
await worker.StopAsync();
service.Dispose();

Connection String Format

Endpoint=<scheduler-url>;TaskHub=<taskhub-name>;Authentication=<auth-type>

See Authentication Types for supported credential types.

Configuration Options

The AzureManagedOrchestrationServiceOptions class provides configuration for the Durable Task Scheduler backend.

Creating Options

From connection string (recommended):

var options = AzureManagedOrchestrationServiceOptions.FromConnectionString(connectionString);

Manual construction:

var options = new AzureManagedOrchestrationServiceOptions(
    address: "https://myscheduler.westus3.durabletask.io",
    credential: new DefaultAzureCredential());
options.TaskHubName = "my-task-hub";

Authentication Types

The connection string Authentication property supports these credential types:

ValueCredential TypeUse Case
DefaultAzureDefaultAzureCredentialGeneral purpose; tries multiple auth methods
ManagedIdentityManagedIdentityCredentialAzure-hosted apps; add ClientId for user-assigned
WorkloadIdentityWorkloadIdentityCredentialKubernetes, CI/CD pipelines, SPIFFE
EnvironmentEnvironmentCredentialContainer apps with env var credentials
AzureCLIAzureCliCredentialLocal dev with az login
AzurePowerShellAzurePowerShellCredentialLocal dev with Connect-AzAccount
VisualStudioVisualStudioCredentialLocal dev from Visual Studio
InteractiveBrowserInteractiveBrowserCredentialInteractive scenarios (not for production)
NoneNo authenticationLocal emulator only

User-assigned managed identity example:

Endpoint=https://myscheduler.westus3.durabletask.io;TaskHub=default;Authentication=ManagedIdentity;ClientId=00000000-0000-0000-0000-000000000000

Concurrency Settings

Control how many work items are processed in parallel:

PropertyDefaultDescription
MaxConcurrentOrchestrationWorkItemsProcessorCount * 10Max parallel orchestration executions
MaxConcurrentActivityWorkItemsProcessorCount * 10Max parallel activity executions
var options = AzureManagedOrchestrationServiceOptions.FromConnectionString(connectionString);
options.MaxConcurrentOrchestrationWorkItems = 50;
options.MaxConcurrentActivityWorkItems = 100;

Tip

Increase activity concurrency for I/O-bound workloads. Reduce orchestration concurrency if orchestrations consume significant memory.

Large Payload Storage

For payloads exceeding gRPC message limits, configure Azure Blob Storage to externalize large data:

var options = AzureManagedOrchestrationServiceOptions.FromConnectionString(connectionString);
options.LargePayloadStorageOptions = new LargePayloadStorageOptions("UseDevelopmentStorage=true")
{
    ExternalizeThresholdBytes = 1024,      // Externalize payloads larger than 1KB
    MaxExternalizedPayloadBytes = 4194304, // Max 4MB payload size
    CompressPayloads = true                // Compress before storing (default: true)
};
PropertyDescription
Constructor (connectionString)Azure Storage connection string or "UseDevelopmentStorage=true" for local dev
ExternalizeThresholdBytesPayloads larger than this are stored in blob storage
MaxExternalizedPayloadBytesMaximum allowed payload size (fails fast if exceeded)
CompressPayloadsWhether to compress payloads before storing (improves storage efficiency)

When enabled, large orchestration inputs, outputs, activity results, and event payloads are automatically stored in blob storage and retrieved transparently.

Additional Options

PropertyDefaultDescription
TaskHubName"default"Name of the task hub (usually set via connection string)
OrchestrationHistoryCacheExpirationPeriod10 minutesHow long orchestration history is cached in memory
ResourceIdhttps://durabletask.ioOAuth resource ID (change only for sovereign clouds)

Local Development with Emulator

For local development, use the Docker-based emulator:

docker pull mcr.microsoft.com/dts/dts-emulator:latest
docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest

Connect to the emulator:

var connectionString = "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";
var service = new AzureManagedOrchestrationService(
    AzureManagedOrchestrationServiceOptions.FromConnectionString(connectionString),
    loggerFactory);

Access the local dashboard at: http://localhost:8082

Samples

For complete working examples, see the Durable Task Scheduler samples repository.

Additional Resources

Next Steps