scale-tone/DurableFunctionsMonitor

What is a Task Hub?

tomkerkhove opened this issue · 3 comments

I'm new to durable functions so this might be a stupid question, but what is a task hub?

Is that something I can define or is it purely managed by Azure Functions based on the linked Azure Storage Account?

In short, a Task Hub is an isolation level in Durable Functions. Each Durable Functions app instance should use its own Task Hub. Two Function App instances must never use the same Task Hub, otherwise it is a recipy for disaster.

A storage account can have many Task Hubs in it.

If you don't explicitly configure Task Hub name for your app via host.json, a default name will be used (which exactly that default name would be - that is a bit unclear).

Task Hubs are created by the platform at first use. DfMon VsCode extension allows removing unused Task Hubs (but it's your responsibility to ensure that it is really unused).

Does it explain that?

So based on that, it feels like a good idea to consolidate all Function Apps on the same storage account and use different task hub names.

Perfect, thank you!

it feels like a good idea to consolidate all Function Apps on the same storage account

Well, it depends. From security point of view, you might not want to share the same connection string across multiple app instances. Especially if these apps are operating with different kinds of data, with different level of sensitivity.