Azure / azure-stream-analytics

Azure Stream Analytics
MIT License
224 stars 933 forks source link

Query Twin Device tags in Stream Analytics #63

Closed Ilheu closed 2 years ago

Ilheu commented 5 years ago

Is it possible to use twin device information in my Stream analytics queries ?

StreamingTodd commented 5 years ago

What device twin information are you interested in? This is not supported currently. The preferred method is to take a snapshot of your device twin data and then use it as reference data.

Ilheu commented 5 years ago

How can I take that snapshot ? I'm trying to use nodejs to that, but I had not success ...

omki12 commented 3 years ago

even if "device twin" is not supported, "device twin tag" is supported. so basically what u can do is, use "Message Enrichment" to add your "device twin property" to "device twin tag property", and can use this in stream analytics.

ref links: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-message-enrichments-overview

so msg flow will be : Message -> Enrich message = (Message + twin.tag) -> Stream analytics