How to automate the process of creating IoTHub, IoT Device

Vishruti Pawar 21 Reputation points
2020-03-11T08:59:03.273+00:00

I just wanted to know if it is possible to create Azure IoThub, IoT Device through API. I want to reduce the manual work to create an IoTHub and IoT Device from the portal. So is it possible to automate this process by any means?? Can we do it without certifications?? Please let me know more information on the same. Thank you.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,825 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ronen Ariely 15,096 Reputation points
    2020-03-12T06:58:10.853+00:00

    I just wanted to know if it is possible to create Azure IoThub, IoT Device through API.

    There is already API to control AzIotHub which is "AzIotHub cmdlet"

    You can use it with your own schedule or application


  2. Sander van de Velde 28,236 Reputation points MVP
    2020-04-15T15:06:20.47+00:00

    I wrote a blog in the past about adding and updating device registration using the Azure SDK in C#.

    Perhaps this helps you to automate the process.

    It needs only the right access policy for the IoT Hub.

    Be aware, this policy/connection string has te be kept secure, at least in production! I recommend to execute the code (and the key) within Azure (eg a webapp or an azure function) and not on your laptop. This way the actual secret can be stored in Azure Vault.