Asked by:
List of IoT Devices linked to a specific DPS

Question
-
User-1665621014 posted
I am trying to create a portal for provisioning a device and I want to provide a drop down list containing all IoT hubs linked to my DPS. I am looking for something that will solve this issue. I already tried to google it. Can somebody help please?
Friday, July 26, 2019 12:28 PM
All replies
-
User283571144 posted
Hi Sushrut Deo,
According to your description, I suggest you could try to use below rest API to get the all assignedHub information.
You could post request to below url and analysis the response.
https://your-dps.azure-devices-provisioning.net/registrations/{id}/query?api-version=2019-03-31
The response will contain the assignedHub for the regiested device.
More details, you could refer to below url:
Best Regards,
Brando
Monday, July 29, 2019 2:21 AM -
User-1665621014 posted
Thank you Brando.
Monday, July 29, 2019 7:47 AM -
User-1665621014 posted
Hi Brando,
I am looking for something like this:
az iot dps linked-hub list --dps-name MyDps --resource-group MyResourceGroup
Any pointers?
Monday, July 29, 2019 9:10 AM -
User283571144 posted
Hi Sushrut Deo,
As far as I know, the az iot command also send the request API to azure to get the resource.
I suggest you could try to use fiddler to capture the request and you could write the codes to send the request as the fildder shows.
Best Regards,
Brando
Monday, August 5, 2019 5:55 AM -
User-1665621014 posted
Thank you so much. I will try to do that.
Monday, August 5, 2019 8:58 AM