Share via

Azure Durable Task Scheduler: Does changing hubName auto-provision a new Task Hub, or is pre-provisioning required

Leo Liu 40 Reputation points
2026-03-10T03:02:51.4+00:00

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:

  1. Each deployment to the staging slot injects a new, unique TASKHUB_NAME (e.g., ScheduledTransfers_20260310_42) via environment variable.
  2. 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.
  3. After warm-up, we execute a slot swap. The old slot (now staging) continues draining its orchestrations on the old Task Hub until completion.
  4. 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"):

  1. Does setting a new TASKHUB_NAME value against an existing DURABLE_TASK_SCHEDULER_CONNECTION_STRING automatically 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?
  2. If pre-provisioning is required, what is the recommended approach?
    • az durabletask taskhub create CLI command in CI/CD?
    • Bicep Microsoft.DurableTask/schedulers/taskHubs resource?
    • Some other method?
  3. 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!

Azure Functions
Azure Functions

An Azure service that provides an event-driven serverless compute platform.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.