You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-devguide-device-twins.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ ms.author: wesmc
7
7
ms.service: iot-hub
8
8
services: iot-hub
9
9
ms.topic: conceptual
10
-
ms.date: 06/10/2019
10
+
ms.date: 02/01/2020
11
11
---
12
12
13
13
# Understand and use device twins in IoT Hub
@@ -240,11 +240,15 @@ The [Azure IoT device SDKs](iot-hub-devguide-sdks.md) make it easy to use the pr
240
240
241
241
Tags, desired properties, and reported properties are JSON objects with the following restrictions:
242
242
243
-
* All keys in JSON objects are UTF-8 encoded, case-sensitive, and up-to 1 KB in length. Allowed characters exclude UNICODE control characters (segments C0 and C1), and `.`, `$`, and SP.
243
+
* **Keys**: All keys in JSON objects are UTF-8 encoded, case-sensitive, and up-to 1 KB in length. Allowed characters exclude UNICODE control characters (segments C0 and C1), and `.`, `$`, and SP.
244
244
245
-
* All values in JSON objects can be of the following JSON types: boolean, number, string, object. Arrays are not allowed. The maximum value for integers is 4503599627370495 and the minimum value for integers is -4503599627370496.
245
+
* **Values**: All values in JSON objects can be of the following JSON types: boolean, number, string, object. Arrays are not allowed.
246
246
247
-
* All JSON objects in tags, desired, and reported properties can have a maximum depth of 10. For instance, the following object is valid:
247
+
* Integers can have a minimum value of -4503599627370496 and a maximum value of 4503599627370495.
248
+
249
+
* String values are UTF-8 encoded and can have a maximum length of 4 KB.
250
+
251
+
* **Depth**: The maximum depth of JSON objects in tags, desired properties, and reported properties is 10. For example, the following object is valid:
248
252
249
253
```json
250
254
{
@@ -276,15 +280,23 @@ Tags, desired properties, and reported properties are JSON objects with the foll
276
280
}
277
281
```
278
282
279
-
* All string values can be at most 4 KB in length.
280
-
281
283
## Device twin size
282
284
283
-
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.
285
+
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`.
286
+
287
+
Twin size is computed as follows:
288
+
289
+
* For each property in the JSON document, IoT Hub cumulatively computes and adds the length of the property's key and value.
290
+
291
+
* Property keys are considered as UTF8-encoded strings.
292
+
293
+
* Simple property values are considered as UTF8-encoded strings, numeric values (8 Bytes), or Boolean values (4 Bytes).
294
+
295
+
* The size of UTF8-encoded strings is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1).
284
296
285
-
The size is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1) and spaces that are outside of string constants.
297
+
* Complex property values (nested objects) are computed based on the aggregate size of the property keys and property values that they contain.
286
298
287
-
IoT Hub rejects with an error all operations that would increase the size of those documents above the limit.
299
+
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.
Copy file name to clipboardExpand all lines: articles/iot-hub/iot-hub-devguide-module-twins.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ author: chrissie926
5
5
ms.service: iot-hub
6
6
services: iot-hub
7
7
ms.topic: conceptual
8
-
ms.date: 04/26/2018
8
+
ms.date: 02/01/2020
9
9
ms.author: menchi
10
10
---
11
11
@@ -231,11 +231,15 @@ The [Azure IoT device SDKs](iot-hub-devguide-sdks.md) make it easy to use the pr
231
231
232
232
Tags, desired properties, and reported properties are JSON objects with the following restrictions:
233
233
234
-
* All keys in JSON objects are case-sensitive 64 bytes UTF-8 UNICODE strings. Allowed characters exclude UNICODE control characters (segments C0 and C1), and `.`, SP, and `$`.
234
+
* **Keys**: All keys in JSON objects are case-sensitive 64 bytes UTF-8 UNICODE strings. Allowed characters exclude UNICODE control characters (segments C0 and C1), and `.`, SP, and `$`.
235
235
236
-
* All values in JSON objects can be of the following JSON types: boolean, number, string, object. Arrays are not allowed. The maximum value for integers is 4503599627370495 and the minimum value for integers is -4503599627370496.
236
+
* **Values**: All values in JSON objects can be of the following JSON types: boolean, number, string, object. Arrays are not allowed.
237
237
238
-
* All JSON objects in tags, desired, and reported properties can have a maximum depth of 5. For instance, the following object is valid:
238
+
* Integers can have a minimum value of -4503599627370496 and a maximum value of 4503599627370495.
239
+
240
+
* String values are UTF-8 encoded and can have a maximum length of 512 bytes.
241
+
242
+
* **Depth**: All JSON objects in tags, desired, and reported properties can have a maximum depth of 5. For instance, the following object is valid:
239
243
240
244
```json
241
245
{
@@ -257,13 +261,21 @@ Tags, desired properties, and reported properties are JSON objects with the foll
257
261
}
258
262
```
259
263
260
-
* All string values can be at most 512 bytes in length.
261
-
262
264
## Module twin size
263
265
264
-
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.
266
+
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`.
267
+
268
+
Twin size is computed as follows:
269
+
270
+
* For each property in the JSON document, IoT Hub cumulatively computes and adds the length of the property's key and value.
271
+
272
+
* Property keys are considered as UTF8-encoded strings.
273
+
274
+
* Simple property values are considered as UTF8-encoded strings, numeric values (8 Bytes), or Boolean values (4 Bytes).
275
+
276
+
* The size of UTF8-encoded strings is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1).
265
277
266
-
The size is computed by counting all characters, excluding UNICODE control characters (segments C0 and C1) and spaces that are outside of string constants.
278
+
* Complex property values (nested objects) are computed based on the aggregate size of the property keys and property values that they contain.
267
279
268
280
IoT Hub rejects with an error all operations that would increase the size of those documents above the limit.
0 commit comments