Sendig AVRO structure message to Azure IoT Hub

Kumar, Aman 1 Reputation point
2020-11-07T11:22:05.4+00:00

I am trying to send an AVRO structure message to Azure IoT Hub and consume the same.
The problem is I am not able to change or manipulate the Device Twin in the AVRO structure. Can we have our Device Twin configured as an AVRO structure or is it not ye supported.

The real reason behind this is we want to change all the message communication structures as AVRO format for our Azure IoT Hub Communication.

Please help

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,179 questions
Azure IoT SDK
Azure IoT SDK
An Azure software development kit that facilitates building applications that connect to Azure IoT services.
218 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 33,101 Reputation points
    2020-11-09T08:43:38.443+00:00

    @Kumar, Aman Welcome to Microsoft Q&A forum!
    Thanks for reaching out to us!

    How exactly are you sending messages to IoT Hub? Are collecting data from sensors and sending to IoT Hub? Are you using message routing? Please provide more details to help you better.

    Device twins are JSON documents that store device state information including metadata, configurations, and conditions. AFAIK you cannot change the format. Please see Understand and use device twins in IoT Hub

    IoT Hub supports writing data to Azure Storage in the Apache Avro format as well as in JSON format. The default is AVRO. When using JSON encoding, you must set the contentType to application/json and contentEncoding to UTF-8 in the message system properties. Both of these values are case-insensitive. If the content encoding is not set, then IoT Hub will write the messages in base 64 encoded format.

    For more details , please see Use IoT Hub message routing to send device-to-cloud messages to different endpoints

    Please let us know if that answers or need further help.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.