Can IoT Edge Device ID associate with multiple Virtual Machines

Dhanavath Vishnu 366 Reputation points
2023-02-20T17:16:37.3433333+00:00

Hi Team,

I was testing this scenario of associating same IoT Edge device Connection string with multiple virtual machines, that means two IoT Edge runtime environments with same device cloud identity, is this possible, if so, how it identifies which environment is the right one.

I was under assumption that, only one cloud device identity associated with one physical device (virtual machine), is this correct understanding or not?

Thanks

D. Vishnu

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
548 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,138 questions
0 comments No comments
{count} votes

Accepted answer
  1. QuantumCache 20,106 Reputation points
    2023-02-20T21:14:00.37+00:00

    Hello Dhanavath Vishnu, this is a great scenario everybody should know! thanks for posting this question on this forum!

    It is not recommended to associate the same IoT Edge device connection string with multiple virtual machines. As we know that each IoT Edge device should have a unique identity, which includes a unique device ID and device authentication credentials (such as a device connection string).

    Coming to the multiple VMs with same device connection String: If you associate the same IoT Edge device connection string with multiple virtual machines, it can cause conflicts and unpredictable behavior. Each virtual machine will try to establish a connection to the IoT hub using the same device identity, which can cause issues with device-to-cloud messaging, device authentication, and other IoT Edge functionality.

    Therefore, it is recommended to associate a unique device identity (including a unique device ID and device authentication credentials) with each virtual machine or physical device that hosts an IoT Edge runtime. This will ensure that each IoT Edge device has a unique identity and can function properly within the IoT Edge architecture.

    Below is a sample test when 2 devices are simultaneously using the same device connection string to send the telemetry!!!
    User's image

    Apart from sending telemetry issues, we may see the below errors during provisioning and Authentication process.

    DeviceIdentityConflict: This error occurs when you try to register a device identity that is already in use by another device. This error may be thrown when you try to register a new device or when you try to connect an existing device to the IoT hub.

    DeviceAlreadyExists: This error occurs when you try to create a new device identity with a name that is already in use. This error may be thrown when you try to register a new device using a connection string that is already associated with another device.

    Unauthorized: This error occurs when the device authentication credentials (such as the device key or SAS token) provided in the connection string are not valid for the device identity associated with that connection string. This error may be thrown when you try to connect a device using a connection string that is already associated with another device.


    If this answers your query, do click Accept Answer and Yes for this answer as helpful. And, if you have any further query do let us know by commenting in the below section.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful