azurepropertiesazure-iot-hubazure-iot-hub-device-management

Without maintaining last reported version, is there a way to get an event only when there is a change in device twins reported properties?


Using IOTHub message routing feature, I am able to listen device twin change notifications whenever there is any change in device twin.
No matter whether it is a change in tags or reported properties or desired properties.
What I am looking for is a way to filter out events when reported properties are changed. I don't want (or I would like to ignore) any notification for changes in tags or desired properties.

For now, as of my research it can be only done by maintaining last reported properties version and comparing it with new event reported properties version.

Please enlighten me if any other way is there without having to maintain last version details somewhere.


Solution

  • your Message routing should be configured with the following:

    Data Source: TwinChangeEvents

    Routing Query: IS_OBJECT($body.properties.reported)