Azure-docs: How to specify the Device Template when using DPS needs more clarification

Created on 3 Dec 2020  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

@jimbobbennett asked me to open this issue on Discord: https://discord.com/channels/702724176489873509/703326290551373974/780613633058144257

More Details here:
https://stackoverflow.com/questions/64826684/how-to-automatically-associate-a-device-with-a-device-template

Summary... its not clearly documented when using the Python IoT Device SDK how to pass the template associated to the device.

provisioning_device_client.provisioning_payload = {"modelId": "your_device_template_URN"} The URN is the Interface @id which is found when you View Identity on the Template itself.

There is also some use of the words "id" in the code and "urn" in the UI which is confusing as well.


Document Details

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

assigned-to-author doc-enhancement iot-centrasvc triaged

Most helpful comment

Hi @askpatrickw - I've added some more information about the model ID to both the code tutorials and the device connectivity concepts article - there's also some additional links to more detailed information. The updates should be live later today.
I'll pass on your comments about the Python code sample to authors of the sample.

Thanks for the feedback - always welcome!

All 5 comments

@askpatrickw Thanks for the feedback! We are currently investigating and will update you shortly.

@askpatrickw I think @dominicbetts replied on Stackoverflow. Please comment here if you need further help with this issue.

It is great to see that new content created. I love that you're always creating more value !

Some feedback

  1. The original page still lacks this information: https://docs.microsoft.com/en-us/azure/iot-central/core/concepts-get-connected#associate-a-device-with-a-device-template
  2. The provisioning_payload isn't mentioned in the SDK Wiki https://github.com/Azure/azure-iot-sdk-python/wiki/key-word-arguments-during-client-creations
  3. I find that newly created python example to be sort of odd to read. The use of a "switch" variable called switch doesn't feel very Pythonic. I'm not a language syntax\style guru, but its worth considering. I know in other languages there is a Switch and in Python there is not so I know how you got there... Seems me calling it what is is, so every instance of switch you know what you are using is better. Totally a nitpick. I could totally be talked out of that I'm sure. ;-)
  4. Where the "model id" is found is still very opaque. It is definitely one of those when you learn you'll remember sort of things, but the fact it is buried under View identity is not obvious to people who will be using sample code.

image

If you choose to close this or not is up to you, I'm just trying to point out where dots aren't being connected for people new to the platform. Cheers!

Hi @askpatrickw - I've added some more information about the model ID to both the code tutorials and the device connectivity concepts article - there's also some additional links to more detailed information. The updates should be live later today.
I'll pass on your comments about the Python code sample to authors of the sample.

Thanks for the feedback - always welcome!

please-close

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ponant picture Ponant  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments