IoT Hub Continues to Send Events After Device Deletion

Tuan Tran 21 Reputation points
2024-12-11T08:29:35.52+00:00

Hi Everyone, I have an issue with IoT Hub, Could you help ?

Events such as TwinChangeEvents and DeviceLifecycleEvents are routed from IoT Hub to Event Hub. However, after deleting the deviceId (S5_U0_15312) created in 2016, IoT Hub still sends deviceLifecycleNotification/twinChangeNotification events indefinitely. Additionally, it is not possible to create a device twin with the same Id on IoT Hub. What could be the cause of this issue, and how can it be resolved?

Untitled Diagram3

Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,222 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
663 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 33,951 Reputation points MVP
    2024-12-11T16:34:20.03+00:00

    Hello @Tuan Tran,

    welcome to this moderated Azure community forum.

    If you use the the Azure portal to change devices registration, it can feel these changes are active without any delay.

    Still, changes to an IoT Hub device registration in the device registry can take some time because these are handled in a asynchronous way.

    This is especially seen when multiple devices are changes in bulk.

    I recommend waiting a bit longer and perhaps eg. use the AZ CLI new to the portal UI, just to be sure.

    Keep in mind the EventHub only deletes message once these messages are expired.

    If the messages are consumed (by some consumer group) it feels these are deleted but the Event hub supports a replay of older messages.

    Please check the timestamp of the messages.

    If this is not helping, an Azure support ticket is recommended so the support team can look what is happening with your Iot Hub.


    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 additional answers

Sort by: Most helpful

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.