VSCode 的 Eventhub 触发器设置本地开发

Eventhub Trigger Setup Local Dev for VSCode

我整天都在为这个问题苦苦思索,但就是无法让我的本地 VSCode 开发环境来处理 Python 工作人员的 EventHub 触发。

Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.myfunctionname'. Microsoft.Azure.WebJobs.EventHubs: Value cannot be null. Parameter name: receiverConnectionString.

Function 'Functions.myfunctionname' failed indexing and will be disabled. [10/22/2018 1:17:40 AM] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.)

关于这些东西的文档非常精简,所以我不确定是否不支持这些事件触发器,或者我是否没有正确设置它。

这是我的 local.settings.json 的样子:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsStorage": "{AzureWebJobsStorage}",
    "EventHub":"Endpoint=sb://privatename.servicebus.windows.net/;SharedAccessKeyName=SharedAccessKey;SharedAccessKey=key here"
  }
}

你能从命令行 运行 func extensions install 然后再试一次吗?

作为参考,这里有一些有用的东西examples/pointers: