Dhanavath Vishnu I'm collating my comments and adding as answer for better understanding.
I am looking for retrieving the IoT edge device id using a custom IoT Edge module. The Idea is whenever, a deployment is done on a IoT edge device which is having IoT Edge runtime on Linux amd64, on the successful running of custom IoT Edge module, can the custom IoT Edge Module pick the device id from the IoT Edge runtime.
Can you please elaborate more on "can the custom IoT Edge Module pick the device id from the IoT Edge runtime." ?
You have access to that via environment variables which are being passed into your module: IOTEDGE_DEVICEID (you can do a docker inspect on your module to see for more details)
Also, Here is an example of python how to use the IOTEDGE_DEVICEID
environment variable to get the device ID in a custom IoT Edge module:
import os
device_id = os.environ["IOTEDGE_DEVICEID"]
Below is the sample code for getting DeviceID using C#.
string deviceId = Environment.GetEnvironmentVariable("IOTEDGE_DEVICEID");