Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Prepare Azure environments for new workloads—subscriptions, networking, identity, and landing zones
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/services/durable-task-scheduler/README.md
1# Durable Task Scheduler23Build reliable, fault-tolerant workflows using durable execution with Azure Durable Task Scheduler.45## When to Use67- Long-running workflows requiring state persistence8- Distributed transactions with compensating actions (saga pattern)9- Multi-step orchestrations with checkpointing10- Fan-out/fan-in parallel processing11- Workflows requiring human interaction or external events12- Stateful entities (aggregators, counters, state machines)13- Multi-agent AI orchestration14- Data processing pipelines1516## Framework Selection1718| Framework | Best For | Hosting |19|-----------|----------|---------|20| **Durable Functions** | Serverless event-driven apps | Azure Functions |21| **Durable Task SDKs** | Any compute (containers, VMs) | Azure Container Apps, Azure Kubernetes Service, App Service, VMs |2223> **💡 TIP**: Use Durable Functions for serverless with built-in triggers. Use Durable Task SDKs for hosting flexibility.2425## Quick Start - Local Emulator2627```bash28# Start the emulator (see https://mcr.microsoft.com/v2/dts/dts-emulator/tags/list for available versions)29docker pull mcr.microsoft.com/dts/dts-emulator:latest30docker run -d -p 8080:8080 -p 8082:8082 --name dts-emulator mcr.microsoft.com/dts/dts-emulator:latest3132# Dashboard available at http://localhost:808233```3435## Workflow Patterns3637| Pattern | Use When |38|---------|----------|39| **Function Chaining** | Sequential steps, each depends on previous |40| **Fan-Out/Fan-In** | Parallel processing with aggregated results |41| **Async HTTP APIs** | Long-running operations with HTTP polling |42| **Monitor** | Periodic polling with configurable timeouts |43| **Human Interaction** | Workflow pauses for external input/approval |44| **Saga** | Distributed transactions with compensation |45| **Durable Entities** | Stateful objects (counters, accounts) |4647## Connection & Authentication4849| Environment | Connection String |50|-------------|-------------------|51| Local Development (Emulator) | `Endpoint=http://localhost:8080;Authentication=None;TaskHub=default` |52| Azure (System-Assigned MI) | `Endpoint=https://<scheduler>.durabletask.io;Authentication=ManagedIdentity;TaskHub=default` |53| Azure (User-Assigned MI) | `Endpoint=https://<scheduler>.durabletask.io;Authentication=ManagedIdentity;ClientID=<uami-client-id>;TaskHub=default` |5455> **⚠️ NOTE**: Durable Task Scheduler uses identity-based authentication only — no connection strings with keys. When using a User-Assigned Managed Identity (UAMI), you must include the `ClientID` in the connection string.5657## Troubleshooting5859| Error | Cause | Fix |60|-------|-------|-----|61| **403 PermissionDenied** on gRPC call (e.g., `client.start_new()`) | Function App managed identity lacks RBAC on the Durable Task Scheduler resource, or IP allowlist blocks traffic | 1. Assign `Durable Task Data Contributor` role (`0ad04412-c4d5-4796-b79c-f76d14c8d402`) to the identity (SAMI or UAMI) scoped to the Durable Task Scheduler resource. For UAMI, also ensure the connection string includes `ClientID=<uami-client-id>`. 2. Ensure the scheduler's `ipAllowlist` includes `0.0.0.0/0` (an empty list denies all traffic). 3. RBAC propagation can take up to 10 minutes — restart the Function App after assigning roles. |62| **Connection refused** to emulator | Emulator container not running or wrong port | Verify container is running: `docker ps` and confirm port 8080 is mapped |63| **403 despite correct RBAC** | Scheduler IP allowlist is empty (denies all) | Set `ipAllowlist: ['0.0.0.0/0']` in Bicep or update via CLI: `az durabletask scheduler update --ip-allowlist '0.0.0.0/0'` |64| **TaskHub not found** | Task hub not provisioned or name mismatch | Ensure the `TaskHub` parameter in the `DURABLE_TASK_SCHEDULER_CONNECTION_STRING` matches the provisioned task hub name |65| **403 Forbidden** on DTS dashboard | Deploying user lacks RBAC on the scheduler | Assign `Durable Task Data Contributor` role to your own user identity (not just the Function App MI) scoped to the scheduler resource — see [Bicep Patterns](bicep.md) for the dashboard role assignment snippet |6667## References6869- [.NET](dotnet.md) — packages, setup, examples, determinism, retry, SDK70- [Python](python.md) — packages, setup, examples, determinism, retry, SDK71- [Java](java.md) — dependencies, setup, examples, determinism, retry, SDK72- [JavaScript](javascript.md) — packages, setup, examples, determinism, retry, SDK73- [Bicep Patterns](bicep.md) — scheduler, task hub, RBAC, CLI provisioning74- [Official Documentation](https://learn.microsoft.com/azure/azure-functions/durable/durable-task-scheduler/durable-task-scheduler)75- [Durable Functions Overview](https://learn.microsoft.com/azure/azure-functions/durable/durable-functions-overview)76- [Sample Repository](https://github.com/Azure-Samples/Durable-Task-Scheduler)77- [Choosing an Orchestration Framework](https://learn.microsoft.com/azure/azure-functions/durable/durable-task-scheduler/choose-orchestration-framework)78