Why does disable on a device not disable the device

Oetze van den Broek 131 Reputation points
2025-03-26T16:49:11.4566667+00:00

I am using Azure IoT Hub and DPS.

We have implemented reprovisioning once a device is blocked in Azure IoT Hub.

When i disable the device in Azure IoT Hub by setting "Enable connection to IoT Hub" to false, clicking save and then rebooting the device. I would assume that no new connection would be allowed. But the device connects without problems and i can still interact with it (send commands).

How do i properly block the device (and force reprovisioning as a result)

I believe the steps i'm taking are correct. Could this be a bug?

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

2 answers

Sort by: Most helpful
  1. Sander van de Velde | MVP 36,131 Reputation points MVP
    2025-03-26T20:41:45.27+00:00

    Hello @Oetze van den Broek ,

    welcome to this moderated Azure community forum.

    This is not a bug but part of a larger workflow so this is a known flow and there is a simple solution.

    If a device is disabled in the IoT Hub, the device will try to reprovision via the Device Provisioning Service.

    Just disable the device registration in the Device Provisioning Service too.

    Then reprovisioning to the same or another IoT Hub is disabled at the (DPS) source.


    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.


  2. Manas Mohanty 3,125 Reputation points Microsoft External Staff
    2025-03-27T15:59:28.7166667+00:00

    Hi Oetze van den Broek

    We have noticed that you rated an answer as not helpful. We appreciate your feedback and are committed to improving your experience with the Q&A.

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Ask: Setting Device connection false from IOT hub is not stopping Devices to connect.

    Solution: From the investigation on Customer side, it was found out that customer had primary certificates aside device connection strings to connect through MQTT broker. It was suggested to revoke the underlying primary certificates along setting device connection false to completely stop the device connecting back.

    If I missed anything please let me know and I'd be happy to add it to this answer, or feel free to comment below with any additional information.

    If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

     

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    Thank You.


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.