Home > database >  Is there a way to get sensor data from IoT central a MySQL database?
Is there a way to get sensor data from IoT central a MySQL database?

Time:01-18

I created simulated sensors that send the data heartrate, blood pressure and temperature. However, I am not sure how to send this data to a MySQL database. I believe that one of the ways I can do it is use Azure functions to send the data, but I am not sure how to go about it. Can anyone help?

CodePudding user response:

Yes, you can use Azure Functions to send data from your simulated sensors to a MySQL database. One way to do this is to create an HTTP-triggered Azure Function that can receive the sensor data and insert it into the MySQL database.

CodePudding user response:

Welcome to the community! You can achieve your use case with the following steps.

  1. Push data from Azure IoT Central to an Azure cloud end point such as Event Hub or Service Bus. Here are the supported cloud destinations. enter image description here

Note If this is a mockup project and you are using MySQL database for testing, I would recommend going with Azure Data Explorer instead. It will eliminate the need for next two steps if you decide to go with Export to Azure Data Explorer. If you still would like to use MySQL database, go with either of the following options-- a) Export to Service Bus b) Export to Event Hubs

  1. Create an Azure Trigger function based on your cloud end point.

    a) Azure Event Hubs trigger for Azure Functions

    b) Azure Service Bus trigger for Azure Functions

  2. Within this function, you can write custom code based on the coding language you choose to push data to MySQL database. Here is a reference tutorial that pushes data from Azure Functions to Azure SQL DB -- Azure SQL output binding for Azure Functions

  • Related