gpt4 book ai didi

Azure Durable Function HttpStart 失败 : Webhooks are not configured

转载 作者:行者123 更新时间:2023-12-02 07:38:42 37 4
gpt4 key购买 nike

我已在 Azure Kubernetes 服务中部署了 Azure Durable Http Triggered Function 应用。我使用 Visual Studio Code 来创建函数应用程序。我已按照此 article 的说明进行操作和 Microsoft official documentation .

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

这是我的 HttStart function.json 文件,

{
"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 文件:

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

该应用程序在我的本地环境中完美运行。部署到 AKS 集群后,当我调用 URL 时,它会抛出以下期望

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

是否有我遗漏的配置?如有任何建议,我们将不胜感激。

谢谢。

最佳答案

尝试添加 WEBSITE_HOSTNAME环境变量 <ip-address>:<port>作为值,其中 <ip-address>:<port>指可用于从外部访问您的函数应用的地址。

当您使用依赖于此环境变量的 API 时,会发生此错误。当使用本地核心工具运行时,该值设置为 localhost:7071自动地。在 Azure Functions 托管服务中运行时,此环境变量也预先配置为函数应用的 DNS 名称(例如 myfunctionapp.azurewebsites.net 。对于其他环境(如 AKS),您需要显式添加此环境变量并将其设置为适合您的部署的正确值。

关于Azure Durable Function HttpStart 失败 : Webhooks are not configured,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64400695/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com