I have set up an Azure Event Hub and I am sending AMQP messages in JSON format from a Python script, and am attempting to stream those messages to Power BI using Stream Analytics. The messages a very simple device activity from and IoT device
The Python snippet is
msg = json.dumps({ "Hub": MAC, "DeviceID": id, "DeviceUID": ouid, "Signal": text, "Timestamp": dtz }, ensure_ascii=False, encoding='utf8')
message.body = msg
messenger.put(message)
messenger.send()
I have used the example C# message reader in the MS tutorial to read the data back from the event hub with no problem, the output is:
Message received. Partition: '2', Data: '??{"DeviceUID": "z_70b3d515200002e7_0", "Signal": "/on?1", "DeviceID": "1", "Hub": "91754623489", "Timestamp": "2016-07-15T07:56:50.277440Z"}'
But when I try to test the Stream Analytics input from the Event Hub, I get an error
Diagnostics: Could not deserialize the input event as Json. Some possible reasons: 1) Malformed events 2) Input source configured with incorrect serialization format
I'm not sure what Malformed Events means - I have assumed that Stream Analytics can cope with data sent to an Event Hub via AMQP?
I can't see anything wrong with the JSON as received by the C# app - unless the BOM symbol is causing a problem?
This is my first attempt at all this, and I have searched for any similar posts with no avail, so I'd really appreciate if someone could point me in the right direction.
Cheers Rob