Azure-docs: Clarify "Maximum depth of object in device twin"

Created on 2 May 2019  Â·  9Comments  Â·  Source: MicrosoftDocs/azure-docs

Could we get a clarification on what _Maximum depth of object in device twin_ means?
We are successfully using the following structure for a device twin. I _think_ the depth of this structure is 7, which seems to violate the rule Maximum depth of object in device twin=5.

  "properties": {
    "desired": {
      "SensorConfig": {
        "id": {
          "1": {
            "settings": {
              "storage": 0,
              "scalingFactor": 1

Or is the depth only calculated below "desired", so we have a depth of 5?

How about the metadata, that IoT Hub adds automatically? Do we need to consider this depth (which I think is 8 since each property gets a sub-property called $lastUpdated)?

      "$metadata": {
        "$lastUpdated": "2019-03-18T14:12:38.2265247Z",
        "$lastUpdatedVersion": 2,
        "SensorConfig": {
          "$lastUpdated": "2019-03-18T14:12:38.2265247Z",
          "$lastUpdatedVersion": 2,
          "id": {
            "1": {
              "$lastUpdated": "2019-03-18T14:12:38.2265247Z",
              "$lastUpdatedVersion": 2,
              "settings": {
                "$lastUpdated": "2019-03-18T14:12:38.2265247Z",
                "$lastUpdatedVersion": 2,
                "storage": {
                  "$lastUpdated": "2019-03-18T14:12:38.2265247Z",

My experiments show that trying to add a property below "storage" yields the following error message:

BadRequest:{ "Message": "ErrorCode:ArgumentInvalid;Property or Tag name should be maximum of 5 levels deep. Error in Property/Tag storage"

This seems to confirm that the depth is calculated with start at the _Device twin path_, which in our case is _properties.desired.SensorConfig_, and that the metadata is only affected indirectly (it will never have a depth of more than 6)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

assigned-to-author billinsvc product-question triaged

All 9 comments

@mfalkvidd Thanks for your question. We are checking on this and will respond to you soon.

@rothja Could you please verify this info and update us here. This might require inputs from PG.

@mfalkvidd Please check the documentation to understand how tags and properties defined along with the depth. Regarding your first structure, after desired the depth will be 4.
Do let us know if you have further questions.

@AshokPeddakotla-MSFT yes that documentation is clear. Maybe a reference to that documentation could be added to https://docs.microsoft.com/en-us/azure/azure-subscription-service-limits ?

@mfalkvidd Sure, we will look into this. We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.

Will you remember to add a reference if this issue is closed?
The reason this issue was opened was that I was unable to find relevant information on the page referenced. That page is still lacking the information I asked for, so I wouldn't consider this issue closed.

@mfalkvidd I can work on adding that link for you. @AshokPeddakotla-MSFT, can you reopen this and assign it to me for tracking. Thanks, and sorry for the confusion.

@mfalkvidd I have updated links for two of the device twin settings including the one you mentioned. When this merges, this git issue will close. Thank you! @robinsh FYI.

Also, it might take a few hours before the merged change is published live. Thanks.

Looks great, thank you!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

smcd253 picture smcd253  Â·  44Comments

renattomachado picture renattomachado  Â·  42Comments

m-andersen picture m-andersen  Â·  65Comments

tvperez76 picture tvperez76  Â·  55Comments

clangnerakq picture clangnerakq  Â·  46Comments