Skip to content

Publish device twin Message

To publish device twin messages:

  1. Connect the devices and subscribe to the device twin subscription topics.

    • $iothub/twin/res/#
    • $iothub/twin/PATCH/properties/desired/#
  2. Update the device twin desired properties using the Update Device Twin API.

  3. The device will receive notifications in the device twin response topic
    $iothub/twin/PATCH/properties/desired/?$version={version}

  4. The device should update the reported properties using the topic
    $iothub/twin/PATCH/properties/reported/?$rid={request id}

  5. Applications can monitor the reported properties set by devices using the Get device twin details.