Is Device Provisioning Service not case sensitive?

Niclas Zettervall 0 Reputation points
2023-11-03T10:10:30.49+00:00

In IoT Hub documentation it says that deviceId is case sensitive:

User's image

 

 

Due to different reasons we need to change the Common Name in our certificates to always be lowercase. Hence we have some already out with uppercase. I they expire the new one will be changed to lowercase.

I made a test to see what happens if the device was provisioned by the Device Provisioning Service and had a certificate where CN was uppercase. The deviceId in the IoT hub matches the CN and sending data is ok.

 User's image

User's image

 

Then I made a certificate with “same” CN in lowercase, and made a device provisioning. Then I expected to get a new device in the IoT Hub since the deviceId shall be case sensitive but this happens:

User's image

User's image

 

The same device in the IoT Hub is updated with the new cert thumbprint instead of creating a new device with lowercase.

Trying to send telemetry data or update the device twin (with any of the certs) now results in UnauthorizedError.

The only way to fix is to delete the device in the IoT Hub and then make the provisioning again. Then a device with lowercase is created.

 

Seems that Device Provisioning Service not handles the deviceId as case sensitive when searching in its records and updates a device instead of creating a new.

 

Is this a bug in DPS? I need to know if we need to handle this when this scenario will happen to some of our devices in the future.

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

Your answer

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