【发布时间】:2022-01-24 18:55:24
【问题描述】:
我使用 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 的配置选项卡中定义。 我使用了具有管理、发送和侦听权限的连接字符串-主键。
我有什么遗漏的吗?
【问题讨论】:
标签: azure-functions azure-eventhub azure-eventhub-capture