I'm having trouble exporting data from IoT Central into Azure Data Explorer (ADX). The reason is that my IoT devices send telemetry with a range of values. For example these are valid messages
{
"deviceId": 1,
"data": {"temperature": 10}
}
{
"deviceId": 2,
"data": {"humidity": 40}
}
I can export to ADX if I create a table with a dynamic data field - then it will contain the entire "data". But I'd like to have columns for temperature and humidity. So I create a table as
.create table iot (deviceId:string, temperature:real, humidity:real)
but it will not be populated by the data export.
I'm using a transform in IoT Central export:
{
deviceId .device.id,
timestamp: .enqueuedTime,
temperature: .data[] | select(.name=="temperature") | .value,
humidity: .data[] | select(.name=="humidity") | .value,
}
and the preview shows it picks those values correctly from my template json. I'd expect ADX to have nulls in the column for which there is no data in a given message. So how to make the export work?
btw I'm aware ingestion mappings could be useful but I could not figure out how to make them run when using IoT Central, since I cannot connect to a Hub source..