Azure函数EventHubTriggerAttribute未使用local.settings.json中的事件中心名称

Azure函数EventHubTriggerAttribute未使用local.settings.json中的事件中心名称,azure,azure-functions,Azure,Azure Functions,我遇到一个问题,我的EventHubTriggerAttribute不再使用local.settings.json文件来填充属性中的事件中心名称。这就是我得到的错误: 在上面的错误中,它正在查找ddhubnamespace.servicebus.windows.net/eventhubname,它实际上应该是ddhubnamespace.servicebus.windows.net/ddhub 这是TriggerAttribute中的事件中心名称: public static void Run(

我遇到一个问题,我的EventHubTriggerAttribute不再使用local.settings.json文件来填充属性中的事件中心名称。这就是我得到的错误:

在上面的错误中,它正在查找ddhubnamespace.servicebus.windows.net/eventhubname,它实际上应该是ddhubnamespace.servicebus.windows.net/ddhub

这是TriggerAttribute中的事件中心名称:

public static void Run([EventHubTrigger("eventHubName", Connection = "eventHubConnection")]string data, TraceWriter log)
这是使用local.settings.json文件,我必须从这里获取eventHubName:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_EXTENSION_VERSION": "~1",
    "eventHubConnection": "Endpoint=sb://ddhubnamespace.servicebus.windows.net/;...",
    "eventHubName": "ddhub",

如果在属性中,我将在local.settings.json ddhub中为实际事件中心名切换出eventHubName。该函数将成功运行。将属性中的Connection属性设置为json名称也将从json中获取值。你知道为什么我的eventhubname不再从json中提取,而是将其作为文本字符串吗

要从配置文件中获取值,应在属性参数中将其标记为%

[EventHubTrigger%eventHubName%,Connection=eventHubConnection]
要从配置文件中获取值,应在属性参数中将其标记为%

[EventHubTrigger%eventHubName%,Connection=eventHubConnection]
谢谢你,你这个光荣的人!一定是在我的代码更改中删除了它。谢谢你,你这个光荣的人!必须在我的代码更改中的某个点删除该选项。