Azure-docs: Device Provisioning using DPS

Created on 23 Jul 2019  Â·  18Comments  Â·  Source: MicrosoftDocs/azure-docs

I saw that this tutorial is showing steps for manual device provisioning but is automatic device provisioning using Azure IoT Hub DPS supported? If yes, is it documented somewhere?


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author iot-edgsvc product-question triaged

Most helpful comment

@Alberto-Vega-MSFT I'm looking into @ppavanm's question about whether DPS can be used to provision downstream devices

All 18 comments

@ppavanm Thanks for reaching out, this guide shows how to do things in the portal but below also shows the same operation through a scripts, you could pick one version like bash and put the pieces together to create your automated DPS.

@ppavanm Just wanted to make sure that I understood your question correctly and also wanted to add that Yes you can use DPS to provision millions of devices in a secure and scalable manner with no human intervention

Hi @ppavanm was the link I shared useful? More specifically you could try using the CLI to automate https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision-cli or an ARM template https://docs.microsoft.com/en-us/azure/iot-dps/quick-setup-auto-provision-rm

@Alberto-Vega-MSFT Thank you for your response, I understood how DPS can be used to provision an edge device. What I am trying is downstream device provisioning using DPS where downstream device is an application running on the same edge device acting as a transparent gateway.

@kgremban would it be possible to add a link to an automated provisioning doc in the section:

_The steps in this article show manual device provisioning, not automatic provisioning with the Azure IoT Hub Device Provisioning Service._

@Alberto-Vega-MSFT I'm looking into @ppavanm's question about whether DPS can be used to provision downstream devices

@kgremban Thank you for the help.

@kgremban any suggestion?

Hi @ppavanm, I confirmed that DPS for downstream devices is not a feature at this time. It's technically doable, though. As long as your downstream device has internet connectivity (which is should, since you're using the same physical device as your IoT Edge gateway) you can use the regular DPS steps to provision the downstream device. After that, you'll have to manually adjust the connection string to point to the gateway, and make sure that any necessary certificates are in place as usual for a transparent gateway scenario.

Does that answer your question?

Hi @kgremban, as you said I am trying to provisioning downstream device with regular DPS steps. When I try to use device pfx file with password 1234 for registering the device, I get an exception saying "The specified network password is not correct".

@kgremban, okay, I am now able to provision downstream device using DPS. After that I manually updated my IoT Device to set the parent device as my edge device. Now if I try to use above c# code to authenticate the device it does not work!

First, If I give gateway hostname as IoT Hub hostname, like DeviceClient.Create("mygatewayhostname", auth, TransportType.Amqp_Tcp_Only), it throws exception saying - "Missing IOT hub name".

So I am providing my IoT Hub Hostname first, DeviceClient.Create("myIotHub.azure-devices.net", "mygatewayhostname>", auth, TransportType.Amqp_Tcp_Only), it throws exception saying - "The remote certificate is invalid according to the validation procedure."

Thanks for the extra details. I see that someone else opened an issue on the same code sample this week (https://github.com/MicrosoftDocs/azure-docs/issues/36838) so I'm following up to see if something changed in the SDK or if I missed something in the documentation.

Update:
The only way I am able to connect downstream device is - create device manually and use Mqtt protocol.

@kgremban As you suggested in above comment I tried creating device using regular DPS step, manually setting its parent to the edge device but it is not working (tried both Amqp and Mqtt).

@kgremban - do you have any update on this issue?

Hi @ppavanm I don't have anything new to add about provisioning downstream devices using DPS. Like I said earlier, it's not a feature that we support at this time so I can't document anything about it. I think some customers have gotten it working, though, so you may have better luck asking for tips on StackOverflow or something.

As for your "Missing IOT hub name" error, I would suspect that means your child device can't communicate with your gateway device. Do you get an "OK" result when you run the test command in Test the gateway connection on your child device?

Hello, we are also trying to implement this scenario.
I think this is the main related issue that makes implementing the scenario difficult and the reason why it didn't work when you tried it:
(#24358)

@kgremban, any update on if will be supported?

@ppavanm, any details to share?

@ksaye No, I have no update about this being a supported feature. Since this issue is around feature requests, and we can't make any updates to the documentation for that, I'm going to close this issue. Thanks everyone.

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

spottedmahn picture spottedmahn  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments

bityob picture bityob  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments