Size from Devicetwin

Vithushan Varatharajan 21 Reputation points
2021-08-09T09:17:14.517+00:00

What will i get when the Desired Properties or Reported Properties or tags section is more then the allowed size ?
I wanna know the exact Error message

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,157 questions
{count} votes

1 answer

Sort by: Most helpful
  1. AshokPeddakotla-MSFT 30,511 Reputation points
    2021-08-25T09:42:27.78+00:00

    @Vithushan Varatharajan If you are looking for specific to IoTHub, below will help.

    IoT Hub enforces an 8 KB size limit on the value of tags, and a 32 KB size limit each on the value of properties/desired and properties/reported. These totals are exclusive of read-only elements like $etag, $version, and $metadata/$lastUpdated.

    Twin size is computed as follows:

    • For each property in the JSON document, IoT Hub cumulatively computes and adds the length of the property's key and value.
    • Property keys are considered as UTF8-encoded strings.
    • Simple property values are considered as UTF8-encoded strings, numeric values (8 Bytes), or Boolean values (4 Bytes).
    • The size of UTF8-encoded strings is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1).
    • Complex property values (nested objects) are computed based on the aggregate size of the property keys and property values that they contain.

    IoT Hub rejects with an error all operations that would increase the size of the tags, properties/desired, or properties/reported documents above the limit.

    At any given time, you can increase quotas or throttle limits by increasing the number of provisioned units in an IoT hub.

    Please refer the below documentations for more details.

    Understand and use device twins in IoT Hub and IoT Hub quotas and throttling

    If the response is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments