Azure IoT Central > Device has no access to IoT Hub

Pietro 41 Reputation points
2023-08-02T08:47:07.88+00:00

Hello,

I have several provisioned devices in Azure IoT Central. Send Device Event REST endpoint is used to post telemetry data.

I have 2 devices that were registered to the same IoT Hub that receive the following error during posting data User's image

The devices have "Provisioned" status in Azure IoT Central and were able to post data during last 3 months

Error2

Do you have any idea why IoT Hub retrieved during device provisioning becomes unavailable?

By the way, it is second time when I see this issue (previously i have to re-provision my devices).

Thank you in advance,

Petro

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
344 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,120 questions
{count} votes

Accepted answer
  1. AshokPeddakotla-MSFT 27,401 Reputation points
    2023-08-17T09:58:35.1666667+00:00

    Hi Pietro

    I'm glad that your issue is resolved 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.

    Error Message:

    User's image

    Solution:

    Azure Support adviced to use IoT Central Device Bridge to hide registration/re-assignment of devices under the hood. What actually is good idea.

    Note, that mentioned IoT Central Device Bridge has the following logic:

    • Try to get device connection string from local cache
    • if connection string exists, use it to send telemetry to Azure IoT Central
    • If connection string does not exist, register and assign to new IoT Hub device. Take into account that Azure Function is not "warm" forever. If you don't use it for several minutes it becomes "cold" and local cache will be lost. It means that next time you send new request, a device will be re-assigned to new IoT Hub. It maybe not very big problem from functional point of view, but it take additional time, so performance is definitely effected

    I have to make improvements to have the following logic:

    • Try to get device connectiion string from local cache
    • if connection string exists, use it to send telemetry to Azure IoT Central
    • if connection string does not exist, try to get assigned hub
    • if assigned hub received, use it to send telemetry to Azure IoT Central
    • if device does not have assigned hub, register and assign it
    • If sending of telemetry is failed due to ENOTFOUND, force re-assignment of device

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

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Pietro 41 Reputation points
    2023-08-10T13:57:54.3966667+00:00

    It seems assigned IoT Hubs are gone.

    Azure Support adviced to use IoT Central Device Bridge to hide registration/re-assignment of devices under the hood. What actually is good idea.

    Note, that mentioned IoT Central Device Bridge has the following logic:

    • Try to get device connection string from local cache
      • if connection string exists, use it to send telemetry to Azure IoT Central
      • If connection string does not exist, register and assign to new IoT Hub device. Take into account that Azure Function is not "warm" forever. If you don't use it for several minutes it becomes "cold" and local cache will be lost. It means that next time you send new request, a device will be re-assigned to new IoT Hub. It maybe not very big problem from functional point of view, but it take additional time, so performance is definitely effected

    I have to make improvements to have the following logic:

    • Try to get device connectiion string from local cache
      • if connection string exists, use it to send telemetry to Azure IoT Central
      • if connection string does not exist, try to get assigned hub
        • if assigned hub received, use it to send telemetry to Azure IoT Central
        • if device does not have assigned hub, register and assign it
    • If sending of telemetry is failed due to ENOTFOUND, force re-assignment of device
    1 person found this answer helpful.