I am trying to persist incoming IOT Hub D2C messages to an Azure Cosmos DB using Azure Stream Analytics. Every Azure Stream Analytics tutorial I can find assumes that messages incoming from the IOT Hub input are of the same shape, which is not true for my case (for testing purposes I am using the tempSensor module from the IOT Edge Module examples and another custom made module based on this tutorial).
This is why I want to filter out the messages that I don't want to persist (i.e. the messages sent by the tempSensor module). In the documentation about using the IOT Hub as an Azure Stream Analysis input, a "StreamId" is mentioned:
"IoTHub.StreamId: A custom event property added by the sender device."
My idea is to use a WHERE clause in the Azure Stream Analytics query to only select messages that have a certain StreamId, but I have no Idea how to set this StreamId when sending a message from within my custom made IOT edge module.
- How can I set the StreamId when sending a message to the IOT Hub from an IOT Edge Device?
- Is there any other way to filter out unwanted messages?