简体   繁体   中英

Azure: How to connect to IOT-Central directly, via API or Webhook?

I would like to to know if there is a way to directly connect to IOT-Centrals Rest-API, I would like to create a web-application from the telemetry data which are displayed there. As far as my knowledge gets, I believe i need to get that Json string to port the data to my web-app. I am open to any suggestion:)

Thank you very much everyone!

The Azure IoT Central (IoTC) is a SaaS application built on the top of the internal Azure IoT Hub. The goal of the IoTC is to hide and abstract all infrastructure around the IoT Hub for rapid development of the IoT Solution. For this reason, the IOTC is giving to you some access permission for device connectivity, etc.

I do recommend to read the document Device connectivity for Azure IoT Central , where you can find the references how to obtain a device connection string based on the IoT Central properties such as scopeId , deviceId and primaryKey .

Once you have a device connection string, you can connect your device to the internal IoT Hub of the Azure IoT Central.

The following example shows a demonstration of the publishing telemetry data of the Plug & Play IoT device to the IoT Central preview application (Plug and Play IoT feature). Note, that the Authorization header is required for the POST request. This sas token can be obtained from the device connection string.

在此处输入图像描述

and the IoT Central shows the result on the dashboard:

在此处输入图像描述

As you can see the above POST request, the "hard part" is to obtain the namespace of the internal IoT Hub, in my example is the value iotc-1e97f318-f85b-42fa-88f8-4f27f7d5a85d . Once we have this value, the device connection string is:

HostName=iotc-1e97f318-f85b-42fa-88f8-4f27f7d5a85d.azure-devices.net;DeviceId=azurekit-1;SharedAccessKey=**device-primary-key**

ps if you are using a C# and need a help with an implementation of the device connection string and Authorization header for connectivity to the Azure IoT Central, I can add it to this thread. Also, have a look at how is implemented an IoTC-Device-Bridge .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM