azure-functions

How can I deploy a function app to a slot in Azure?


I have a function app in Azure. I have created a slot and deploy to the slot. The issue is I can't see my functions and get the error:

Microsoft.Azure.WebJobs.Extensions.DurableTask: Task Hub name must be specified in host.json when using slots.
Specified name must not equal the default HubName (myfuncapp).

We were not able to load some functions in the list due to errors. Refresh the page to try again. See details
Encountered an error (InternalServerError) from host runtime.

I have created a unique name in the host.json file and re-deployed. Still no difference.

How can I fix this ?


Solution

  • Microsoft.Azure.WebJobs.Extensions.DurableTask: Task Hub name must be specified in host.json when using slots. Specified name must not equal the default HubName (myfuncapp).

    To resolve this error, you have to add Task Hub name in host.json as below.

    host.json:

    {
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request"
          },
          "enableLiveMetricsFilters": true
        }
      },
      "extensions": {
        "durableTask": {
          "hubName": "MyTaskHub"
        }
      }
    }
    

    Able to deploy the function to Deployment slot of Azure function app:

    enter image description here

    Portal:

    enter image description here