Share via

Programatically setting default hubname at azure durable function startup time

Anonymous
2022-03-31T20:03:58.377+00:00

I'm trying to port some Azure Durable Functions code from .NET Core 3.1 to .NET 6.0. In 3.1 the default hub name was set at startup like this

builder.Services.AddDurableTask(options => { options.SetDefaultHubName(hubName); });

but AddDurableTask is no longer available in 6.0. What's the .NET 6.0 way of doing this?

Azure Functions
Azure Functions

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

0 comments No comments

1 answer

Sort by: Most helpful
  1. Lohith GN 516 Reputation points Microsoft Employee
    2022-04-05T00:06:23.863+00:00

    @Anonymous Just to be clear - you are using .NET6.0 as the framework and you have a In-Process model of Azure Functions. Is this correct ?

    Reading from the documentation - there are 2 ways of setting HubName.

    1. in host.json
    2. in host.json but the value is set in your local.settings.json for development and in function app app settings in production,

    Here is the official documentation on setting the hub name: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-task-hubs?tabs=csharp

    Without having full context, its not easy to understand what you are trying to do.

    Was this answer helpful?


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.