Reputation: 83
i have got a problem regarding saving telemetry data/json into a blob storage. The problem is that the saved data has sort of encrypted my valuable telemetry data.
{"EnqueuedTimeUtc":"2019-11-25T15:42:51.5340000Z","Properties":{},"SystemProperties":{"to":"/devices/device-08/messages/events","connectionDeviceId":"device-08","connectionAuthMethod":"{\"scope\":\"device\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}","connectionDeviceGenerationId":"xxxxxxxxxxxxx","contentEncoding":"","enqueuedTime":"2019-11-25T15:42:51.5340000Z"},"Body":"eyJ0ZW1wIjo3LjM5LCJodW0iOjczLjUsInJzc2kiOi04OSwic25yIjo4Ljh9"}
I think the problem also lays within "contentEncoding":"" cause it should be"contentEncoding":"utf-8".
Does anyone know how to fix this :) thank you very much for your efforts!
Upvotes: 1
Views: 788
Reputation: 8235
Have a look at this document.
Set the device message system properties such as the contentType to application/json and contentEncoding to UTF-8.
In the case when your device is using the MQTT protocol directly, use the topic for passing the system properties, for example:
devices/mydeviceId/messages/events/$.ct=application%2Fjson&$.ce=utf-8
Update:
The following screen snippets are showing an example of the quick test for Data export to the blob storage.
As you can see, the published topic is
devices/device1/messages/events/$.ct=application%2Fjson&$.ce=utf-8
and 6 messages have been sent to the IoT Central.
As you can see, the body of each device message is not Base64 encoded json text.
Note, that only contentType and contentEncoding of the device message will decide if the body is Base64 encoded or not.
Upvotes: 3