I have a .net application simulating an iot device. It is using Microsoft.Azure.Devices.Client to create device messages and send them to the iothub which then routes them to an event hub where Azure Stream Analytics has it as an input.
I have the following in the "simulator":
messageToSend = new Message(Encoding.ASCII.GetBytes(JsonConvert.SerializeObject(message.Payload)))
{
MessageId = new Guid().ToString(),
ContentType = "application/json",
ContentEncoding = "utf-8",
};
messageToSend.Properties.Add("test", "test");
In my azure stream analytics query i have:
SELECT *, GetMetadataPropertyValue(InputEH, '[User].[test]') as test
INTO OutputEH
FROM InputEH
WHERE test = 'test'
For some reason the query never outputs any data to OutputEH. I have tried the same query except instead of adding the "test" property to the MessageProperties i have put it in the message body and it works as expected if my query uses "WHERE InputEh.test = 'test'"
To validate the properties I set the output to an eventhub and set up an event hub processor on it and as the messages come in if I remove the "WHERE" clause. In the event hub processor it appears that the headers have been removed, this tells me ASA is dropping the headers for some reason.
Not sure what I'm doing wrong here. Any help would be appreciated.