Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

task hub name must be specified in host.json when using slots

enter image description here

On adding a staging slot in my function app, I see the error:

task hub name must be specified in host.json when using slots

I updated host.json as follows:

{
    "version": "2.0",
    "extensions": {
        "durableTask": {
        "hubName": "staging"
        }
    }
}

Should I specify 2 hub names - for production and staging slots?

How do I fix that?

like image 796
user989988 Avatar asked Sep 16 '25 22:09

user989988


2 Answers

AzureFunctionsJobHost__extensions__durableTask__hubName = "YOURTASKHUBNAME"

You have to use this key/value pair in configuration

like image 139
Sandeep Kumar Avatar answered Sep 19 '25 16:09

Sandeep Kumar


Task hubs can also be configured using app settings

Check documentation here: https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-task-hubs?WT.mc_id=Portal-WebsitesExtension&tabs=csharp#task-hub-names

You'd configure the specific value in each slot's settings.

Go to the Environment variables blade for your Function App's Slot.

In the App settings tab, add a new variable named TaskHubName with Deployment slot setting checked. Now you can set this variable to different values on each slot.

like image 20
Nirmal Patel Avatar answered Sep 19 '25 16:09

Nirmal Patel