Hello,
Need help with using many instances of IoT Hub.
Let's say there are 1 DPS service and 4 linked IoT Hub instance. All Microsoft.Devices.DeviceCreated events from IoT Hub routes to ServiceBus Topic. Then I have a simple consumer to handle those events and store deviceId and hubName to the database.
I need to send C2D message. Get device ID from the database and call the direct method. To call it, I need ServiceClient instance, connected to the appropriate IoT Hub.
How to get a connection string to that IoT Hub? How to manage that? Are there any docs/samples/common approach?
Thank you in advance.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@Marusyk Thanks for the feedback! We are currently investigating and will update you shortly.
@Marusyk
Please have a look at the Azure IoT DPS REST API dcumentation.
Example:

Please let us know if you need further help.
Also for C2D you can refer to these to get started.
@Marusyk Please let us know if you need further help.
@SatishBoddu-MSFT Thank you very much for your help. I'm going to close the issue.
Most helpful comment
@Marusyk
Please have a look at the Azure IoT DPS REST API dcumentation.
Example:
You can see the response which gives you a list of IoT Hubs which are connected to the DPS along with their connection string.
Please let us know if you need further help.
Also for C2D you can refer to these to get started.