ADX数据接收停止之后 我有非常奇怪的问题。我有IOT应用程序,该设备将数据发送到Iot Hub,然后将其路由到Event Hub。具有触发功能作为Azure函数,此函数将数据插入到...

问题描述 投票:0回答:1
注意 - 一段时间后,我可以在ADX中看到数据(ADX中没有更改都没有重新启动任何服务或设备)。

任何人都知道到底可能会出现什么问题?

adx

,由于未正确添加日期字段 /发送的消息是恒定 /线性的,因此未收到数据。确保正确发送遥测有效载荷。 below是发送遥测IoT消息的代码:

async def send_telemetry_from_thermostat(device_client, telemetry_msg): msg = Message(json.dumps(telemetry_msg)) msg.custom_properties["iothub-creation-time-utc"] = datetime.now(timezone.utc).isoformat() msg.content_encoding = "utf-8" msg.content_type = "application/json" print("Sent message") await device_client.send_message(msg)

azure azure-iot-hub azure-data-explorer
1个回答
0
投票
I使用此

Microsoft文档将JSON形式的数据吸收到振动数据Explorer

.

BELOW是我在ADX中创建的样本表:
.create table sampleTable ( messageId: int, deviceId: string, temperature: decimal, humidity: decimal, temperatureAlert: string, IotHubDeviceId: string, IotHubEnqueuedTime: datetime )

贝洛是上表的样本流摄取和JSON映射: .alter table sampleTable policy streamingingestion enable .create table sampleTable ingestion json mapping "JsonTelemetryMapping" '[' '{"Column": "messageId", "Properties": {"Path": "$.messageId"}},' '{"Column": "deviceId", "Properties": {"Path": "$.deviceId"}},' '{"Column": "temperature", "Properties": {"Path": "$.temperature"}},' '{"Column": "humidity", "Properties": {"Path": "$.humidity"}},' '{"Column": "temperatureAlert", "Properties": {"Path": "$.Properties.temperatureAlert"}},' '{"Column": "IotHubDeviceId", "Properties": {"Path": "$.iothub-connection-device-id"}},' '{"Column": "IotHubEnqueuedTime", "Properties": {"Path": "$.iothub-enqueuedtime"}}' ']'

输出:

to thisdocumentation tothisdocumentation

iothub
.

检查此Microsoft文档用于将IoT数据转换为事件Hubs

,然后将其导出到

振应数据explorerOutput Imagehere

here。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.