An Azure service that provides an event-driven serverless compute platform.
Azure Durable Task Scheduler: Does changing hubName auto-provision a new Task Hub, or is pre-provisioning required
Context
We're running an Azure Durable Functions v4 app (Node.js, durable-functions SDK v3) that uses the Azure Managed Durable Task Scheduler as its storage provider — not the legacy Azure Storage backend.
Our host.json configuration:
{
"extensions": {
"durableTask": {
"hubName": "%TASKHUB_NAME%",
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DURABLE_TASK_SCHEDULER_CONNECTION_STRING"
}
}
}
}
We're implementing a zero-downtime deployment strategy using deployment slots + dynamic Task Hub isolation. The idea is:
- Each deployment to the staging slot injects a new, unique
TASKHUB_NAME(e.g.,ScheduledTransfers_20260310_42) via environment variable. - The staging slot starts up and connects exclusively to the new Task Hub — fully isolated from the production slot's in-flight orchestrations on the old Task Hub.
- After warm-up, we execute a slot swap. The old slot (now staging) continues draining its orchestrations on the old Task Hub until completion.
- The next timer trigger fires in the new production slot, starting fresh orchestrations on the new Task Hub.
This pattern prevents NonDeterministicWorkflowException when breaking changes are deployed while long-running orchestrations (several hours) are still in flight.
The Question
With the Azure Managed Durable Task Scheduler ("type": "azureManaged"):
- Does setting a new
TASKHUB_NAMEvalue against an existingDURABLE_TASK_SCHEDULER_CONNECTION_STRINGautomatically provision a new Task Hub at runtime? Or do we need to pre-create the Task Hub resource (via Bicep/ARM/CLI) before the Function App starts? - If pre-provisioning is required, what is the recommended approach?
-
az durabletask taskhub createCLI command in CI/CD? - Bicep
Microsoft.DurableTask/schedulers/taskHubsresource? - Some other method?
-
- Cleanup: What is the recommended way to decommission/delete old Task Hubs after their orchestrations have fully drained? Is there an API or CLI command to check for zero in-flight instances and then safely delete?
Environment
ComponentVersion / DetailAzure Functions Runtimev4@azure/functions4.8.0durable-functions3.2.0Extension BundleMicrosoft.Azure.Functions.ExtensionBundle.Preview [4.37.0, 4.38.0)Storage ProviderazureManaged (Durable Task Scheduler)LanguageTypeScript / Node.js >= 18HostingDedicated App Service Plan (not Consumption)Any guidance or pointers to documentation would be greatly appreciated. Thanks!
and click on Yes for was this answer helpful. And, if you have any further query do let us know.