This template repository contains a Durable Functions sample demonstrating the fan-out/fan-in pattern in TypeScript (using the Azure Functions Node.js v4 programming model). The sample can be easily deployed to Azure using the Azure Developer CLI (azd). It uses managed identity for all service-to-service authentication and optionally a virtual network to make sure deployment is secure by default. You can opt out of a VNet being used in the sample by setting VNET_ENABLED to false in the parameters.
Durable Functions is part of the Azure Functions offering. It helps orchestrate stateful logic that's long-running or multi-step by providing durable execution. An execution is durable when it can continue in another process or machine from the point of failure in the face of interruptions or infrastructure failures. Durable Functions handles automatic retries and state persistence as your orchestrations run to ensure durable execution.
State for this sample is managed by Azure Durable Task Scheduler (DTS), a fully managed backend provider for Durable Functions. Compared with the classic Azure Storage backend, DTS delivers:
- Higher and more predictable orchestration throughput
- A dedicated dashboard for viewing and debugging orchestrations
- A purpose-built data store — no Storage queues/tables required
- Managed-identity-based auth from your Function App to the scheduler
This sample uses the standard Functions extension bundle (
Microsoft.Azure.Functions.ExtensionBundle) and theMicrosoft.DurableTask/schedulers@2026-02-01resource provider.
- Node.js 20+
- Azure Functions Core Tools v4
- Azure Developer CLI (
azd) - Azure CLI
- Docker — required to run the local DTS emulator
- To use Visual Studio Code to run and debug locally:
You can initialize a project from this azd template in one of these ways:
-
Use this
azd initcommand from an empty local (root) folder:azd init --template durable-functions-quickstart-typescript-azd
Supply an environment name, such as
dfquickstartwhen prompted. Inazd, the environment is used to maintain a unique deployment context for your app. -
Clone the GitHub template repository locally using the
git clonecommand:git clone https://github.com/Azure-Samples/durable-functions-quickstart-typescript-azd.git cd durable-functions-quickstart-typescript-azdYou can also clone the repository from your own fork in GitHub.
DTS provides a Docker-based emulator so you can develop and test without provisioning Azure resources.
-
Start the DTS emulator (includes the dashboard on port 8082):
docker run --name dts-emulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
-
Create
src/local.settings.jsonfrom the sample:cp src/local.settings.json.sample src/local.settings.json
The sample file contains the emulator connection string and task hub:
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "node", "DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;Authentication=None", "TASKHUB_NAME": "default" } } -
Install dependencies and start the function host:
cd src npm install npm start -
Trigger the orchestration:
curl -i http://localhost:7071/api/orchestrators/fetchOrchestration
-
View the run in the emulator dashboard at http://localhost:8082.
-
Sign in and provision + deploy everything in one step:
azd auth login azd up
-
Pick an environment name, subscription, and region. The allowed region list is defined in
infra/main.bicepand defaults tonorthcentralus. -
Once the deployment finishes,
azdprints the HTTP trigger URL. You can also run:azd show
to retrieve the function app name and the DTS endpoint.
-
Invoke the orchestration in Azure:
curl -i https://<your-function-app>.azurewebsites.net/api/orchestrators/fetchOrchestration
- A user-assigned managed identity (UAMI) used by the Function App
- An Azure Storage account (blob only — for deployment package and
AzureWebJobsStorage) - An Azure Functions Flex Consumption plan + Function App (Node 20)
- Log Analytics workspace + Application Insights
- An Azure Durable Task Scheduler (
Microsoft.DurableTask/schedulers) and a task hub - RBAC:
Storage Blob Data Owneron the storage account for the UAMIMonitoring Metrics Publisheron Application Insights for the UAMIDurable Task Data Contributoron the DTS scheduler for the UAMI (and for the deployer, so you can open the dashboard)
The Function App is configured with these DTS-specific app settings:
| Setting | Value |
|---|---|
DURABLE_TASK_SCHEDULER_CONNECTION_STRING |
Endpoint=<dts-url>;Authentication=ManagedIdentity;ClientID=<uami-client-id> |
TASKHUB_NAME |
The name of the provisioned task hub |
DTS ships a portal-integrated dashboard for browsing orchestrations, inspecting history, and viewing status in near real-time.
- Local (emulator): http://localhost:8082
- Azure (deployed): open the DTS scheduler resource in the Azure portal and click Dashboard, or navigate directly to https://dashboard.durabletask.io and sign in to your task hub.
You can also query Application Insights for traces emitted by the DurableTask.AzureManagedBackend category, which is enabled in src/host.json.
azd down --purge
docker rm -f dts-emulator.
├── azure.yaml # azd service descriptor (service: api -> ./src)
├── infra/
│ ├── main.bicep # subscription-scope entry; provisions everything
│ ├── main.parameters.json
│ ├── abbreviations.json
│ └── app/
│ ├── api.bicep # Flex Consumption function app + DTS app settings
│ ├── dts.bicep # Microsoft.DurableTask/schedulers + taskHubs
│ ├── dts-Access.bicep # Durable Task Data Contributor role assignments
│ ├── rbac.bicep # storage + app-insights role assignments
│ ├── vnet.bicep
│ └── storage-PrivateEndpoint.bicep
└── src/
├── host.json # storageProvider.type = azureManaged; standard bundle
├── local.settings.json.sample
├── package.json # durable-functions ^3.1.0, @azure/functions ^4.7.0
├── tsconfig.json
└── fetchOrchestration.ts # HTTP trigger + orchestrator + activity
The commit immediately before this sample was migrated to DTS is preserved as the git tag pre-dts-azure-storage on the maintainer's fork, for historical reference.