2

I am sending data from Azure EDGE to Azure IOT Hub. I have configured routes to Blob storage endpoint. I get the message but when i look at the JSON file, the Body is encrypted. I have configured the endpoint as JSON

{"EnqueuedTimeUtc":"2019-08-30T19:33:53.4120000Z","Properties":{"sequenceNumber":"88","batchId":"16212de8-b502-471d-97d5-55edc6f384f6"},"SystemProperties":{"connectionDeviceId":"xxxE-01","connectionModuleId":"SimulatedTemperatureSensor","connectionAuthMethod":"{\"scope\":\"module\",\"type\":\"sas\",\"issuer\":\"iothub\",\"acceptingIpFilterRule\":null}","connectionDeviceGenerationId":"637027812073417448","enqueuedTime":"2019-08-30T19:33:53.4120000Z"},"Body":"eyJtYWNoaW5lIjp7InRlbXBlcmF0dXJlIjo2Ny45NTc3MzU3MzMzNDIyNzUsInByZXNzdXJlIjo2LjM0OTYxNTQ2MzI5MjE1NzV9LCJhbWJpZW50Ijp7InRlbXBlcmF0dXJlIjoyMC44Njk4MzEwMzQ2MjAyMTIsImh1bWlkaXR5IjoyNH0sInRpbWVDcmVhdGVkIjoiMjAxOS0wOC0zMFQxOTozMzo1My40MTk1MDc4WiJ9"}
TylerH
  • 20,799
  • 66
  • 75
  • 101
Strike
  • 95
  • 1
  • 1
  • 8

2 Answers2

3

the body in your sample is a base64 encoded json formatted text:

{"machine":{"temperature":67.957735733342275,"pressure":6.3496154632921575},"ambient":{"temperature":20.869831034620212,"humidity":24},"timeCreated":"2019-08-30T19:33:53.4195078Z"}
Roman Kiss
  • 7,925
  • 1
  • 8
  • 21
1

I have seen this occur if the content-encoding property of the message isn't set properly? Is it set properly on your message. most of them are utf-8.

  • Any suggestion how to set the encoding while sending messages . – Strike Sep 12 '19 at 02:47
  • @Strike, basically this is a system properties of the message stored in the header part. If your device is using MQTT protocol directly, the system/users properties are part of the publish topic, e.g. **devices/myDeviceId/messages/events/$.ct=application%2Fjson&$.ce=utf-8** – Roman Kiss Sep 12 '19 at 06:28
  • @RomanKiss is right for a pure MQTT client.. if you are using one of our SDKs, there are various methods for doing it (let me know what SDK you are using and we can help you find it).. if it's the C# SDK, for example, it's // Set message body type and content encoding message.contentEncoding = "utf-8"; message.contentType = "application/json"; – Steve Busby - MSFT Sep 13 '19 at 03:17