0
votes

Hello stack community.

I'm trying to send a simple message from a device to the Iot Hub, and then store this message on Blob.

To do so:

  • on the IoT Hub, i created a Router with the following property: level='storage';
  • on the IoT Hub, i created an endpoint;

Everything works fine, except i get this warning when i inspect the Blob through the Azure platform showing me some bad characters:

The file 'xxxxxxxxxxx' may not render correctly as it contains an unrecognized extension.

The snippet to send the message from the device to the IoT Hub is the following:

    var temperature = 20 + (Math.random() * 15);
    var humidity = 60 + (Math.random() * 20);            
    var data = JSON.stringify({ deviceId: 'myFirstNodeDevice', temperature: temperature, humidity: humidity });
    var message = new Message(data);
    message.properties.add('level','storage');
    console.log("Sending message: " + message.getData());
    client.sendEvent(message, printResultFor('send'));

I can't figure out what's the real problem. Thank you in advance!

1

1 Answers

0
votes

I haven't seen that message in before. I think this could be caused on how the route was configured. Use the following link for the full setup and integration of OIT hub messages with Azure storage to blob containers: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-store-data-in-azure-table-storage

enter image description here