1

I want to have 2 Durable Functions, that would use separated TaskHub's (different configurations, storage, etc). It's possible to use TaskHubName in the Function declaration, so it must be possible to define them in host.json. Just can't find any example how?

"extensions": {
    "http": { "routePrefix": "" },
    "durableTask": {
      "hubName": "TaskHub1",
   ..
      "hubName": "TaskHub2",

I tried to pass array in durableTask, but it's expecting an object.

1 Answer 1

1

You can define multiple task hubs in your host.json file by using the durableTask extension. refer this link. Each task hub can have its own configuration, storage, and other settings.

host.json:

{
  "version": "2.0",
  "extensions": {
    "durableTask": [
      {
        "hubName": "TaskHub1",
        "storageProvider": "AzureStorage",
        "partitionCount": 16,
        "maxConcurrentActivityFunctions": 10,
        "maxConcurrentOrchestratorFunctions": 10
      },
      {
        "hubName": "TaskHub2",
        "storageProvider": "AzureStorage",
        "partitionCount": 16,
        "maxConcurrentActivityFunctions": 10,
        "maxConcurrentOrchestratorFunctions": 10
      }
    ]
  }
}

local.settings.json:

enter image description here

  • Configured task hubs names as TaskHub1 and TaskHub2. Each task hub uses the AzureStorage storage provider and has a partition count of 16. The maxConcurrentActivityFunctions and maxConcurrentOrchestratorFunctions settings specify the maximum number of activity and orchestrator functions that can run parallel.

enter image description here

I can see that the function triggering both the storage accounts with different tasks assigned.

store2azoct10: enter image description here

azoct10: enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.