I am trying to write Stream analytics query to push iothub data to SQL database.
MY IOTHUB data as follows.
{
"Device_Id":"P371602011",
"kWL1":11.683551775144204,
"EventProcessedUtcTime":"2017-12-28T07:21:14.3829760Z",
"PartitionId":0,
"EventEnqueuedUtcTime":"2017-12-28T07:21:04.6660000Z",
"IoTHub":
{
"MessageId":null,
"CorrelationId":null,
"ConnectionDeviceId":"iotclient",
"ConnectionDeviceGenerationId":"636500361000571958",
"EnqueuedTime":"2017-12-28T07:21:04.0540000Z",
"StreamId":null
}
}
Now i am trying to write Device_Id, kWL1 and EnqueuedTime to SQL database. My Stream analytics query looks like below.
SELECT
Device_Id AS PowerScout,
IoTHub.EnqueuedTime AS [ReadingTime],
kWL1 AS [kW L1]
INTO
[DataBase]
FROM
[IoTHub]
When i run Stream analytics job, i can see Device_Id and kWL1 Values but EnqueuedTime is showing as NULL. How to get EnqueuedTime from IOTHub Data.
{
"DeviceData": [
{
"Device_Id": "5",
"AMPSL1": 1.2515641182178531E-38
}
],
"EventEnqueuedUtcTime": "2018-01-08T05:03:08.0840000Z",
"IoTHub": {
"MessageId": null,
"CorrelationId": null,
"ConnectionDeviceId": "VHW1",
"ConnectionDeviceGenerationId": "636509839893748612",
"EnqueuedTime": "2018-01-08T05:03:06.7460000Z",
"StreamId": null
}
}
How can i get Device_Id and AMPSL1 in above format.
Thanks in Advance
