How to remove old / nonexistent Tag from Device Twin

Jeff Marcum 0 Reputation points
2025-01-10T18:08:00.7633333+00:00

I use IoT Hub to test MQTT connectivity with my company's hardware. I look at tag data I'm sending by using Device Twin (to verify the data was sent to Azure).

If I change the tags I'm sending - the Device Twin still shows old tags (with old data) that I've since removed from my device.

How can I get the Device Twin to show updated information; remove the old tags?

Thanks

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

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 34,201 Reputation points MVP
    2025-01-10T23:36:30.5966667+00:00

    Hello @Jeff Marcum ,

    welcome to this moderated Azure community forum.

    You are referencing tags, device twins and data.

    It must be clear the Azure IoT Hub support MQTT as a communication protocol but only supports a limited set of MQTT topics with specific message formats so IoT Hub device-to-cloud and cloud-to-device communication takes place:

    • You can send telemetry message to the IoT Hub
    • You can receive desired properties (part of the device twin)
    • You can send reposted properties (part of the device twin) (this is an 'expensive' call and normally used as a reply on desired properties to tell the desired state is received)
    • Additionally, direct methods can be handled when the device is live connected

    A device also supports tags.

    These must be seen as context to a device registration (on the cloud side) so incoming messages can be enriched with these tags. These tags can also be used in a more special IoT Edge solution with layered deployments.

    The device cannot reach out to the tags.

    You are talking about tags but I think these are reported properties?

    These reported properties are normally not deleted because it represents the current state. If a device has certain reported properties and new desired properties are supplied, You can check if the device has picked up the changes already.

    Also, the Azure portal experience for the device twin is not automatically refreshed.

    You need to close and open the page again to refresh it.

    It's better to route device twin changes to eg. a storage account so you have a better view on the historical changes of all device twins.

    If you really want to delete tags or desire properties, you need to set then to 'null' (check the information on the device twin page in the portal).


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.