简体   繁体   English

Azure function 触发器与物联网中心“EntityPath”

[英]Azure function trigger with IoT-Hub "EntityPath"

I am currently having troubles with connecting my function trigger to an IoT-Hub, overnight it broke somehow.我目前在将我的 function 触发器连接到 IoT-Hub 时遇到问题,一夜之间它以某种方式坏掉了。 Function version 4. Node.js version 14 LTS. Function 版本 4。Node.js 版本 14 LTS。

First I got an error saying I have to use web.jobs version 4.3.0, I changed the host.json to include this首先我收到一条错误消息说我必须使用 web.jobs 版本 4.3.0,我更改了 host.json 以包括此

主机.json

Then it has started giving me a runtime error which I don't know how to fix, the error:然后它开始给我一个我不知道如何修复的运行时错误,错误:

“[Azure 门户中的错误 (EntityPath)][2]

I defined connection string in the portal which has the format我在具有以下格式的门户中定义了连接字符串

"Endpoint=sb//{iothub-ns-"somename"-"somenumber".servicebus.windows.net/}; SharedAccessKeyName={NameOfAccessKey};SharedAccessKey={TheKey};EntityPath={Name};

Lastly I tried removing the EntityPath which removed the error but then nothing came to the function anymore最后我尝试删除删除错误的 EntityPath 但随后 function 什么也没有了

Edit: I got it fixed by changing function version to 3 and reverting the original Host.json to be "version": "[2.*, 3.0.0)".编辑:我通过将 function 版本更改为 3 并将原始 Host.json 恢复为“版本”来修复它:“[2.*, 3.0.0)”。

I have no idea how the runtime version got changed, even when I made new functions they would also get this error.我不知道运行时版本是如何改变的,即使我制作了新功能,他们也会得到这个错误。 It is probably just something I have done within my workspace that is causing this.这可能只是我在我的工作区内所做的事情导致的。

while defining the connection string give the entity path as even hub compatible name在定义连接字符串时,将实体路径作为偶数集线器兼容名称

Endpoint=sb://<Event hub-compatible endpoint>.servicebus.windows.net/;EntityPath=<Event Hub compatible name>;SharedAccessKeyName=<keyName>;SharedAccessKey=<key>"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM