Azure Durable Function HttpStart failure: Webhooks are not configured

1.7k views Asked by At

I have deployed Azure Durable Http Triggered Function app in Azure Kubernetes Service. I used Visual Studio Code to create the function app. I have followed instructions from this this article and Microsoft official documentation.

Function runtime: 3.0.2630
Python version: 3.7.7
azure-functions: 1.3.1
azure-functions-durable: 1.0.0b9

Here is my HttStart function.json file looks like,

{
  "scriptFile": "__init__.py",
  "bindings": [
    {
      "authLevel": "anonymous",
      "name": "req",
      "type": "httpTrigger",
      "direction": "in",
      "route": "orchestrators/{functionName}",
      "methods": [
        "post",
        "get"
      ]
    },
    {
      "name": "$return",
      "type": "http",
      "direction": "out"
    },
    {
      "name": "starter",
      "type": "orchestrationClient",
      "direction": "in"
    }
  ]
}

Docker file:

FROM mcr.microsoft.com/azure-functions/python:3.0-python3.7

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
    AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY requirements.txt /
RUN pip install -r /requirements.txt

COPY . /home/site/wwwroot

This application works perfectly in my local environment. After deploying to AKS cluster, when I call URL, it throws the following expection

fail: Function.HelloWorldHttpStart[3]
      Executed 'Functions.HelloWorldHttpStart' (Failed, Id=e7dd35a1-2001-4f11-396f-d251cbd87a0d, Duration=82ms)
Microsoft.Azure.WebJobs.Host.FunctionInvocationException: Exception while executing function: Functions.HelloWorldHttpStart
 ---> System.InvalidOperationException: Webhooks are not configured
   at Microsoft.Azure.WebJobs.Extensions.DurableTask.HttpApiHandler.ThrowIfWebhooksNotConfigured() in d:\a\r1\a\azure-functions-durable-extension\src\WebJobs.Extensions.DurableTask\HttpApiHandler.cs:line 737

Is there any configuration I missed out? Any suggestions would be appreciated.

Thank you.

1

There are 1 answers

2
Chris Gillum On BEST ANSWER

Try adding a WEBSITE_HOSTNAME environment variable with <ip-address>:<port> as the value, where <ip-address>:<port> refers to the address that can be used to reach your function app from outside.

This error happens when you use an API that depends on this environment variable. When running using the local core tools, this value is set to localhost:7071 automatically. When running in the Azure Functions hosted service, this environment variable is also pre-configured to be the DNS name of the function app (e.g. myfunctionapp.azurewebsites.net. For other environments, like AKS, you'll need to add this environment variable explicitly and set it to the correct value for your deployment.