Azure Sphere MT3620 device to Azure MySQL database?

Ken Ekholm 151 Reputation points
2023-03-17T11:02:27.1966667+00:00

Is it possible in any way to send sensor data from Azure Sphere MT3620 device to Azure MySQL database?

Azure Sphere
Azure Sphere
An Azure internet of things security solution including hardware, operating system, and cloud components.
167 questions
0 comments No comments
{count} vote

Accepted answer
  1. QuantumCache 20,266 Reputation points
    2023-03-17T17:25:08.22+00:00

    Hello @Ken Ekholm,

    I can suggest few architecture flows in this scenario, there may be other workflows as well, the below may be helpful with your initial query!

    User's image

    1. Connect the Azure Sphere MT3620 device to Azure IoT Hub by following the instructions in the Azure Sphere documentation.
    2. Configure an Azure Stream Analytics job to read the sensor data from the IoT Hub and transform it into a format suitable for storing in a MySQL database. You can use Stream Analytics to filter, aggregate, and join data from multiple sources before sending it to the MySQL database.
    3. Create an Azure Function that is triggered by the output of the Stream Analytics job. The function should use the MySQL Connector/NET library to insert the transformed data into the MySQL database.
    4. Configure the Azure Function to run on a schedule or to be triggered by the arrival of new data in the Stream Analytics output.

    This below solution builds a real-time data ingestion/processing pipeline to ingest and process messages from IoT devices into a big data analytic platform in Azure. The architecture uses Azure Sphere and Azure IoT Hub to manage telematics messages, and Azure Stream Analytics processes the messages.

    User's image

    If you want to send sensor data from an Azure Sphere MT3620 device to an Azure MySQL database directly without using Azure IoT Hub, then please try the below architecture.

    Azure Database for MySQL server firewall rules
    User's image

    1. Configure the Azure Sphere MT3620 device to read sensor data and send it to your Azure MySQL database using the MySQL Connector/NET library. This requires setting up a direct connection to the MySQL server and providing authentication credentials.
    2. To connect to the Azure MySQL database securely, you will need to set up a virtual network in Azure that includes the Azure Sphere device and the MySQL server. This will enable you to use a private IP address to communicate with the MySQL server and prevent unauthorized access to your data.
    3. You will also need to configure firewall rules in the Azure portal to allow incoming traffic on the MySQL server's private IP address from the virtual network where the Azure Sphere device is located.
    4. Once the connection is established, you can use the MySQL Connector/NET library to insert sensor data into your MySQL database.

    Note: Keep in mind that sending data directly from an Azure Sphere MT3620 device to a MySQL database requires careful consideration of security and network configurations. Using Azure IoT Hub as an intermediate step can provide additional security and scalability features, such as device-to-cloud and cloud-to-device messaging, device authentication, and data routing.


    If this answers your query, do click Accept Answer and Yes for this answer as helpful. And, if you have any further query do let us know by commenting in the below section, happy to help!

    1 person found this answer helpful.

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.