| author | hhunter-ms |
|---|---|
| ms.author | hannahhunter |
| title | Quickstart: Configure a Durable Functions app to use Durable Task Scheduler |
| titleSuffix | Durable Task |
| description | Learn how to configure an existing Durable Functions app to use Durable Task Scheduler as a backend. |
| ms.topic | how-to |
| ms.service | durable-task |
| ms.subservice | durable-task-scheduler |
| ms.date | 10/29/2025 |
| zone_pivot_groups | df-languages |
Write stateful functions in a serverless environment using Durable Functions, a feature of Azure Functions. Scenarios where Durable Functions is useful include orchestrating microservices and workflows, stateful patterns like fan-out/fan-in, and long-running tasks.
You can use the Durable Task Scheduler as a backend for your Durable Functions, to store orchestration and entity runtime state.
In this quickstart, you:
[!div class="checklist"]
- Configure an existing Durable Functions app to use the Durable Task Scheduler.
- Set up the Durable Task emulator for local development.
- Deploy your app to Azure on the App Service plan using Visual Studio Code.
- Monitor the status of your app and task hub on the Durable Task Scheduler dashboard.
For C#, this quickstart uses the .NET isolated worker model.
-
An existing Azure Functions project on your local computer: ::: zone pivot="csharp"
::: zone-end
::: zone pivot="javascript"
::: zone-end
::: zone pivot="python"
::: zone-end
::: zone pivot="powershell"
::: zone-end
::: zone pivot="java"
::: zone-end
- Docker installed to run the Durable Task Scheduler emulator.
- Azurite installed.
- An HTTP test tool that keeps your data secure.
::: zone pivot="csharp"
Install the latest version of the Microsoft.Azure.Functions.Worker.Extensions.DurableTask.AzureManaged package by using the dotnet add package command:
dotnet add package Microsoft.Azure.Functions.Worker.Extensions.DurableTask.AzureManaged --prereleaseNote
The Durable Task Scheduler extension requires Microsoft.Azure.Functions.Worker.Extensions.DurableTask version 1.2.2 or higher.
::: zone-end
::: zone pivot="javascript,python,java,powershell"
In host.json, update the extensionBundle property to use the preview version that contains the Durable Task Scheduler package:
{
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle.Preview",
"version": "[4.29.0, 5.0.0)"
}
}::: zone-end
Update the host.json as follows to use Durable Task Scheduler as the backend.
{
"extensions": {
"durableTask": {
"hubName": "%TASKHUB_NAME%",
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DURABLE_TASK_SCHEDULER_CONNECTION_STRING"
}
}
}
}Add connection information for local development:
{
"IsEncrypted": false,
"Values": {
"FUNCTIONS_WORKER_RUNTIME": "<DEPENDENT ON YOUR PROGRAMMING LANGUAGE>",
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"DURABLE_TASK_SCHEDULER_CONNECTION_STRING": "Endpoint=http://localhost:8080;Authentication=None",
"TASKHUB_NAME": "default"
}
}-
Pull the docker image containing the emulator.
docker pull mcr.microsoft.com/dts/dts-emulator:latest
-
Run the emulator.
docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
The following output indicates the emulator started successfully.
:::image type="content" source="media/quickstart-durable-task-scheduler/emulator-started.png" alt-text="Screenshot showing emulator started successfully on terminal.":::
-
Make note of the ports exposed on Docker desktop. The scheduler exposes multiple ports for different purposes:
8080: gRPC endpoint that allows an app to connect to the scheduler8082: Endpoint for Durable Task Scheduler dashboard
:::image type="content" source="media/quickstart-durable-task-scheduler/docker-ports.png" alt-text="Screenshot of ports on Docker.":::
Note
The Durable Task Scheduler emulator stores orchestration data in memory, which means all data is lost when it shuts down.
-
Go to the root directory of your app and start Azurite.
azurite start
-
Run the application.
func start
You should see a list of the functions in your app.
-
Start an orchestration instance by sending an HTTP
POSTrequest to the URL endpoint using the HTTP test tool you chose. -
Copy the URL value for
statusQueryGetUriand paste it in your browser's address bar. You should see the status on the orchestration instance:{ "name": "DurableFunctionsOrchestration", "instanceId": "<instanceID>", "runtimeStatus": "Completed", "input": null, "customStatus": null, "output": [ "Hello Tokyo!", "Hello Seattle!", "Hello London!" ], "createdTime": "2025-02-21T21:09:59Z", "lastUpdatedTime": "2025-02-21T21:10:00Z" } -
To view more details about the orchestration instance, go to http://localhost:8082/ access the Durable Task Scheduler dashboard.
-
Click on the default task hub to see its dashboard.
Running into issues testing? See the troubleshooting guide.
Create a Durable Task Scheduler instance and Azure Functions app on Azure following the Function app integrated creation flow. This experience will automatically set up identity-based access and configure the required environment variables for the app to access the scheduler.
[!INCLUDE function-app-integrated-creation]
Resource deployment could take around 15 to 20 minutes. Once that is finished, you can deploy your app to Azure.
[!INCLUDE functions-publish-project-vscode]
If your app is running on the Functions Premium plan, turn on the Runtime Scale Monitoring setting after deployment to ensure your app autoscales based on load:
az resource update -g <resource_group> -n <function_app_name>/config/web --set properties.functionsRuntimeScaleMonitoringEnabled=1 --resource-type Microsoft.Web/sites
Run the following command to get your function's URL:
az functionapp function list --resource-group <RESOURCE_GROUP_NAME> --name <FUNCTION_APP_NAME> --query '[].{Function:name, URL:invokeUrlTemplate}' --output json
Check the status of the orchestration instance and activity details on the Durable Task Scheduler dashboard. Accessing the dashboard requires you to log in.
[!INCLUDE assign-dev-identity-role-based-access-control-portal]
If you no longer need the resources that you created to complete the quickstart, to avoid related costs in your Azure subscription, delete the resource group and all related resources.
- Learn more about the Durable Task Scheduler dashboard.
- Troubleshoot any errors you may encounter while using Durable Task Scheduler.