The Azure ID of the current device is available on the IOTEDGE_DEVICEID environment variable. Instead read the device ID of the device twin. Note: Device twins are JSON documents that store device state information including metadata, configurations, and conditions. Azure IoT Hub maintains a device twin for each device that you connect to IoT Hub. Device identity properties. The root of the device twin JSON document contains the read-only properties from the corresponding device identity stored in the identity registry. Reference: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-device-twins