Azure / azure-iot-sdk-csharp

A C# SDK for connecting devices to Microsoft Azure IoT services
Other
463 stars 493 forks source link

[Technical Question] How to use Device Registration Status Lookup API #3372

Closed bastyuchenko closed 9 months ago

bastyuchenko commented 11 months ago

In the following documentation Devices that can't store a connection string Microsoft doesn't recommend to connect to Azure DPS each time a device return on-line. Instead, it is recommended to store an Azure IoT Hub assigned to the device by Azure DPS previously or use Device Registration Status Lookup API and re-connect to this Azure IoT Hub every time the device returns online.

How to use Device Registration Status Lookup API from Azure IoT SDK for .NET ?

timtay-microsoft commented 10 months ago

I'm not entirely sure why the documentation you linked is making this suggestion. I would advise you to just call provisioningDeviceClient.RegisterAsync(...) again in cases like this.

The Device Registration Status Lookup API you are referencing is actually part of the provisioning service client and would require another locally saved connection string (a DPS instance level connection string) to execute which defeats the purpose of not caching the device's credentials.

timtay-microsoft commented 9 months ago

I'll go ahead and close this thread since the question has been answered.