Basically I have multiple devices in IoTHub with 30 partition. Now, I want to detect if there is no data being ingested to any devices after 10 mins using Stream Analytics. Once detected, I want to select what device is it and send that information to Azure function for Alert.
The query is a bit tricky given that I'm new with stream analytics. Here is what I came up so far but it seems the out is not what I expected.
SELECT
t1.[IoTHub].[ConnectionDeviceId] as DeviceId
INTO
[NoDataAlertFunctionOutput]
FROM
[iot-hub-data-flow] t1 TIMESTAMP BY Timestamp
LEFT OUTER JOIN [iot-hub-data-flow] t2 TIMESTAMP BY Timestamp
ON
t1.[IoTHub].[ConnectionDeviceId]=t2.[IoTHub].[ConnectionDeviceId]
AND
DATEDIFF(minute,t1,t2) BETWEEN 1 and 10
WHERE t2.[IoTHub].[ConnectionDeviceId] IS NULL
I will greatly appreciate any suggestion or comment.
Here are the references I trying to follow:
On the other hand, is there a built-in functionality in IoTHub to detect if no data ingested at certain time period?