简体   繁体   English

如何利用Function Apps for Azure IoT Hub?

[英]How to make use of Function Apps for Azure IoT Hub?

So I've been trying to generate a small function app (in JS) that responds to a message sent to the Azure IoT Hub. 因此,我一直在尝试生成一个小型功能应用程序(使用JS),以响应发送到Azure IoT中心的消息。 The output is a simple console log. 输出是一个简单的控制台日志。 However, I am unable to load the event hub compatible end point of the IoT Hub as the trigger (the only option available is to create a new Event Hub). 但是,我无法加载IoT中心的事件中心兼容端点作为触发器(唯一可用的选项是创建新的事件中心)。 How do I proceed? 我该如何进行? The code for the device to send to Azure' IoT Hub is working and I am able to view the messages via the Device Explorer tool. 设备发送到Azure的IoT中心的代码正在运行,我可以通过设备资源管理器工具查看消息。

You need to create new Event Hub Connection and use the Event Hub-Compatible endpoint from the Iot Hub Messaging section. 您需要创建新的事件中心连接,并使用“物联网中心消息”部分中的“事件中心兼容”端点。 But you need to change it to match the service bus connection string format - "Endpoint=[your iot hub compatible end point];SharedAccessKeyName=[your key name];SharedAccessKey=[your key];EntityPath=[your event hub compatible name]" 但是您需要更改它以匹配服务总线连接字符串格式-“ Endpoint = [您的iot集线器兼容的端点]; SharedAccessKeyName = [您的键名称]; SharedAccessKey = [您的键]; EntityPath = [您的事件集线器兼容名称]”

key name and key can be taken from the "Shared access policy" section. 密钥名称和密钥可以从“共享访问策略”部分获取。

Good Luck 祝好运

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

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