What are the restrictions on IoT device IDs?

Chris Hibberd 21 Reputation points
2021-10-26T17:46:50.47+00:00

https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-identity-registry#device-identity-properties states that deviceId is:

A case-sensitive string (up to 128 characters long) of ASCII 7-bit alphanumeric characters plus certain special characters: - . + % _ # * ? ! ( ) , : = @ $ '.

Yet when I create a device ID that contains the '=' character I am unable to register my device with the DPS (using an x509 certificate flow). Furthermore, the failed registrations do not appear in the DPS logs. For example:

YnECGGQQACFESqAAoAAA8g== fails to register as a device ID and no logs appear in the log analytics workspace.
YnECGGQQACFESqAAoAAA8g successfully registers as a device ID and logs appear in the log analytics workspace.

I am using version 2.5.1 of the Python azure-iot-device SDK.

Please could you confirm if the document I linked is correct and that YnECGGQQACFESqAAoAAA8g== should be a valid deviceId?

Thanks

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

Accepted answer
  1. Sander van de Velde 28,796 Reputation points MVP
    2021-10-26T21:09:55.933+00:00

    Hello @Chris Hibberd ,

    this is an interesting observation.

    I was able to enter both DeviceIDs in an IoTHub:

    143914-image.png

    So, this IoTHub does not seem to be the issue.

    In the DPS, I can register that DeviceID, only the RegistrationID must be simplified:

    143971-image.png

    (I use individual enrollment, symmetric key)

    So the registration works by hand:

    143962-image.png

    I tried this with a code example from the Github repo Python Azure IoT Device SDK:

    143910-image.png

    So enrollment and assignment works with symmetric keys using a Python SDK example.

    Please check if this works for you too. If so, try the X509 sample.


0 additional answers

Sort by: Most helpful