how to forward masseges from iot edge to iot hub ?

Ahmed Assad 266 Reputation points
2021-01-31T08:03:23.683+00:00

want to aggregate all data from loaf devices to edge and send all data to iot hub or iot central
note : this loaf devices send to data in SQL forum

Azure IoT
Azure IoT
A category of Azure services for internet of things devices.
403 questions
Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
580 questions
Windows for IoT
Windows for IoT
A family of Microsoft operating systems designed for use in Internet of Things (IoT) devices.
404 questions
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
365 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,216 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sander van de Velde | MVP 33,636 Reputation points MVP
    2021-01-31T13:42:30.397+00:00

    Hello @AhmedAssad-8581 ,

    it seems you want to read data from a device that contains a database?

    In that case, write a custom IoT Edge module that is able to execute the SQL query (once every x seconds?) and transforms the result into messages which can be sent to the IoT Hub.

    To build a custom module, you need to use any of the programming languages which are supported by Azure IoT edge SDKs. An example is this NodeJS tutorial. There are also tutorials for C, C#, Python, and Java.

    Some examples of already built modules can be found here.

    Depending on your use case, you can transform each row into a message or all rows into a single message. There is a 256K limitation to a single message.

    Regarding IoT Central, you need to define an IoT Edge device template first for your edge device and the model. For this, you need to create the deployment manifest first. So I recommend starting with Azure IoT Hub first.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.