我在 Azure Function 中使用 Time Trigger 编写了一个 python 代码,该代码从 api 获取数据并将其发送到 Event Hub。当我执行该函数时,我收到以下错误:
System.Private.CoreLib: Exception while executing function: Functions.TimerTrigger. Microsoft.Azure.WebJobs.Host: Error while handling parameter _binder after function returned:. System.Private.CoreLib: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
我的 function.json 如下所示:
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "mytimer",
"type": "timerTrigger",
"direction": "in",
"schedule": "0 */1 * * * *"
},
{
"type": "eventHub",
"name": "output",
"eventHubName": "eventhub-af-project",
"connection": "myconnection",
"direction": "out"
}
]
}
该连接在我的 local.settings.json 以及 Azure 上的配置选项卡中定义。我使用了具有管理、发送和侦听权限的连接字符串-主键。
有什么我错过的吗?