Bilješka
Pristup ovoj stranici zahtijeva provjeru vjerodostojnosti. Možete pokušati da se prijavite ili promijenite direktorije.
Pristup ovoj stranici zahtijeva provjeru vjerodostojnosti. Možete pokušati promijeniti direktorije.
The Durable Task Scheduler is a highly performant, fully managed backend provider for Durable Task with an out-of-the-box monitoring dashboard. Azure offers two developer-oriented orchestration frameworks that work with Durable Task Scheduler to build apps: Durable Task SDKs and Durable Functions.
In this article, you learn to:
- Run the Durable Task Scheduler emulator
- Perform CRUD operations on a scheduler and task hub.
Learn more about Durable Task Scheduler features, supported regions, and plans.
Durable Task Scheduler emulator
The Durable Task Scheduler emulator is only available as a Docker image today.
Pull the Docker image containing the emulator.
docker pull mcr.microsoft.com/dts/dts-emulator:latestRun the emulator.
docker run -itP mcr.microsoft.com/dts/dts-emulator:latestThis command exposes a single task hub named
default. If you need more than one task hub, you can set the environment variableDTS_TASK_HUB_NAMESon the container to a comma-delimited list of task hub names like in the following command:docker run -itP -e DTS_TASK_HUB_NAMES=taskhub1,taskhub2,taskhub3 mcr.microsoft.com/dts/dts-emulator:latest
Prerequisites
Set up the CLI
Sign in to Azure and ensure you have the latest CLI version.
az login az upgradeInstall the Durable Task Scheduler CLI extension.
az extension add --name durabletaskIf you already installed the Durable Task Scheduler CLI extension, upgrade to the latest version.
az extension update --name durabletaskCheck your installed version:
az extension show --name durabletask
Create a scheduler and task hub
Create a resource group.
az group create --name YOUR_RESOURCE_GROUP --location LOCATIONUsing the
durabletaskCLI extension, create a scheduler.az durabletask scheduler create --name "YOUR_SCHEDULER" --resource-group "YOUR_RESOURCE_GROUP" --location "LOCATION" --ip-allowlist "[0.0.0.0/0]" --sku-name "dedicated" --sku-capacity "1"The creation process may take up to 15 minutes to complete.
Output
{ "id": "/subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/YOUR_RESOURCE_GROUP/providers/Microsoft.DurableTask/schedulers/YOUR_SCHEDULER", "location": "northcentralus", "name": "YOUR_SCHEDULER", "properties": { "endpoint": "https://YOUR_SCHEDULER.northcentralus.durabletask.io", "ipAllowlist": [ "0.0.0.0/0" ], "provisioningState": "Succeeded", "sku": { "capacity": 1, "name": "Dedicated", "redundancyState": "None" } }, "resourceGroup": "YOUR_RESOURCE_GROUP", "systemData": { "createdAt": "2025-01-06T21:22:59Z", "createdBy": "YOUR_EMAIL@example.com", "createdByType": "User", "lastModifiedAt": "2025-01-06T21:22:59Z", "lastModifiedBy": "YOUR_EMAIL@example.com", "lastModifiedByType": "User" }, "tags": {} }Create a task hub.
az durabletask taskhub create --resource-group YOUR_RESOURCE_GROUP --scheduler-name YOUR_SCHEDULER --name YOUR_TASKHUBOutput
{ "id": "/subscriptions/YOUR_SUBSCRIPTION_ID/resourceGroups/YOUR_RESOURCE_GROUP/providers/Microsoft.DurableTask/schedulers/YOUR_SCHEDULERS/taskHubs/YOUR_TASKHUB", "name": "YOUR_TASKHUB", "properties": { "provisioningState": "Succeeded" }, "resourceGroup": "YOUR_RESOURCE_GROUP", "systemData": { "createdAt": "2024-09-18T22:13:56.5467094Z", "createdBy": "OBJECT_ID", "createdByType": "User", "lastModifiedAt": "2024-09-18T22:13:56.5467094Z", "lastModifiedBy": "OBJECT_ID", "lastModifiedByType": "User" }, "type": "microsoft.durabletask/scheduler/taskhubs" }
In the Azure portal, search for Durable Task Scheduler and select it from the results.
Select Create to open the Durable Task Scheduler pane.
Fill out the fields in the Basics tab. Select Review + create.
Once the validation passes, select Create.
Deployment may take around 15 to 20 minutes.
View all Durable Task Scheduler resources in a subscription
Get a list of all scheduler names within a subscription by running the following command.
az durabletask scheduler list --subscription <SUBSCRIPTION_ID>You can narrow down results to a specific resource group by adding the
--resource-groupflag.az durabletask scheduler list --subscription <SUBSCRIPTION_ID> --resource-group <RESOURCE_GROUP_NAME>
In the Azure portal, search for Durable Task Scheduler and select it from the results.
You can see the list of scheduler resources created in all subscriptions you have access to.
View all task hubs in a Durable Task Scheduler
Retrieve a list of task hubs in a specific scheduler by running:
az durabletask taskhub list --resource-group <RESOURCE_GROUP_NAME> --scheduler-name <SCHEDULER_NAME>
You can see all the task hubs created in a scheduler on the Overview of the resource on Azure portal.
Delete a scheduler and task hub
Delete the task hub first:
az durabletask taskhub delete --resource-group YOUR_RESOURCE_GROUP --scheduler-name YOUR_SCHEDULER --name YOUR_TASKHUBDelete the scheduler:
az durabletask scheduler delete --resource-group YOUR_RESOURCE_GROUP --scheduler-name YOUR_SCHEDULER
Open the scheduler resource in the Azure portal and select Delete:
Find the scheduler with the task hub you want to delete, then select that task hub. Select Delete:
Configure identity-based authentication for your app to access Durable Task Scheduler
Durable Task Scheduler only supports managed identity authentication using either user-assigned or system-assigned identities. User-assigned identities are recommended because they aren't tied to the lifecycle of the app and can be reused after the app is deprovisioned.
To grant your app access, assign the Durable Task Data Contributor role to the managed identity. For full setup steps, see Configure identity-based access in Durable Task Scheduler.
Access the Durable Task Scheduler dashboard
To access the Durable Task Scheduler dashboard, assign the Durable Task Dashboard Viewer role to your developer identity. For details, see Durable Task Scheduler dashboard.