question

VishrutiPawar-0541 avatar image
0 Votes"
VishrutiPawar-0541 asked ·

How to automate the process of creating IoTHub, IoT Device

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-webapps
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

pituach avatar image
0 Votes"
pituach answered ·

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







· 4 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your response, but in the link it is using azure command line interface to do it, so just a small doubt, is it possible to achieve this using Rest API which will be triggered through some application???
Also is it possible to add IoT Device through CLI??

0 Votes 0 · ·
pituach avatar image pituach VishrutiPawar-0541 ·

The short answer is yes. Using Rest API you can send request to your server and theoretically do whatever you want. You can execute cmdlet in your service which get the request from the Rest API.

The longer answer is that the way to do it depend on the application and technologies and language which your Rest API connect to.

0 Votes 0 · ·

Sure, Thank you so much for the response.

0 Votes 0 · ·
Show more comments
SandervandeVelde42 avatar image
0 Votes"
SandervandeVelde42 answered ·

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.


· 2 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you for your response and the explanation.

0 Votes 0 · ·

Please mark helpful replies as answer.

0 Votes 0 · ·