Hello @Atif Sayeedi ,
Normally, each device sends its own telemetry and receives its own C2D commands or messages.
So, each device has its own credentials and makes contact with the IoT Hub (eg. using the Azure IoT Device SDK).
I checked the samples for Python and found this example in GitHub.
It's event-based so the code is waiting for incoming C2D messages while other work is done.
Here I send a message:
Here it is received:
See how the "Press Q to quit" is already executed while the code waits for the message to be received.
So you can either start creating multiple 'threads' running next to each other in your python code, each with its own device client. They all wait for their own incoming messages. So multiple clients run in parallel.
Or you can try to loop through the list of devices, create a temporary device client which shuts down just after disconnecting the Message Handler. So in the end, only one device client is running, in a serial manner.
Messsages stay on the IoT Hub up to 48 hours before these are removed while not being picked up or accepted by the device client.