azure - 如何处理 "Iot hub"中的两个 "stream analytics job"设备?

标签 azure azure-iot-hub azure-stream-analytics

我正在使用“流分析作业”来可视化来自“物联网中心”的两个不同设备(device1 和 device2)的数据; device1 发送以下消息:

{"messageId": 5576, "deviceId": "Raspberry Pi Web", "rpm": 22.80972122577826, "torque": 72.65678451219686}

device2 发送以下消息:

{"messageId": 1272, "deviceId": "Raspberry Pi Web Client", "temperature": 23.815921380797004, "humidity": 78.7491052866882}

消息是同时发送的,当我想要可视化 power bi 中的数据时,我只能看到其中一条消息的键,messageId、温度、湿度、PartitionId。这些 key 属于device2发送的消息;但设备1对应的messageId、rpm、torque、PartitionId键不会出现。

我在流分析作业中使用的查询如下:

SELECT
    *
INTO
    output
FROM
    input

我的设备是我通过以下链接使用和配置的模拟设备:https://azure-samples.github.io/raspberry-pi-web-simulator/#Getstarted

如何通过流分析作业查看来自同一物联网中心中两个不同设备的消息?

注意:我在“IoT Hub”中使用F1级别

感谢您的帮助

最佳答案

在 PowerBI 中,一个数据集代表单一数据源,并且必须采用以下格式:

There are literally hundreds of different data sources you can use with Power BI. But regardless of where you get your data from, that data has to be in a format the Power BI service can use to create reports and dashboards.

引用:dataset conceptdata source for Power BI .

对于您的问题,您可以将两个设备事件路由到两个 Power BI 数据集。(ASA 作业中的两个输出)。

查询如下所示:

SELECT
    *
INOT
    powerbi
FROM
    iothubevents
WHERE
    deviceId = 'Raspberry Pi Web'


SELECT
    *
INOT
    powerbidevice2
FROM
    iothubevents
WHERE
    deviceId = 'Raspberry Pi Web Client'

查看这些快照: 在流分析工作中:

enter image description here

enter image description here

在 Power BI 中:

enter image description here

enter image description here

关于azure - 如何处理 "Iot hub"中的两个 "stream analytics job"设备?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50339654/

相关文章:

azure - IoT 中心和 ASA 输入之间的 JSON 反序列化过程中部分数据丢失

azure - 流分析条件检查

azure - 为什么测试 JSON 不能转换为日期时间?

azure - 使用 @azure/identity 访问 Key Vault 并收到错误 'Request is missing a Bearer or PoP token Error 401'

Azure 操作组不发送 Outlook 联系人组的电子邮件

Azure IoT 中心消息路由路由查询仅识别所需属性中的更改

c - 交叉编译iot hub sdk时链接错误

azure - 无法在 Microsoft Windows Azure 中注册信用卡

azure - 找不到此应用程序的应用程序访问策略

c# - Azure IoT 中心的RegistryManager 和服务客户​​端- 单例与否?