Data from Azure Sphere MT3620 directly to a Azure MySQL database?

Ken Ekholm 151 Reputation points
2023-03-21T21:08:47.3066667+00:00

Is possible to send data from Azure Sphere MT3620 directly to a Azure MySQL database?

Azure Sphere
Azure Sphere
An Azure internet of things security solution including hardware, operating system, and cloud components.
156 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
714 questions
{count} votes

2 answers

Sort by: Most helpful
  1. QuantumCache 20,031 Reputation points
    2023-03-21T21:27:08.4333333+00:00

    Hello @Ken Ekholm,
    may i know what is the use-case for this scenario? So that we better frame our guidance...

    It is not recommended to directly connect an Azure Sphere MT3620 device to an Azure MySQL database, as it would expose the database to potential security risks. Instead, you should use a secure, scalable, and maintainable approach by sending data through an intermediary cloud service, such as Azure IoT Hub or Azure Functions.

    Update:5-17

    The particularities of Azure Sphere cease once the data reaches the IoT Hub. Beyond this point, it becomes an Azure-related issue.

    To establish an SQL connector, you can utilize an Azure Function, for example, as follows: Store data into SQL database from Azure IoTHub using Azure Functions without Stream Analytics - Stack Overflow

    The better supported way is to use Azure Sphere Data Explorer. A sample for that already exists: azure-sphere-samples/Samples/LoggingToAzure at main · Azure/azure-sphere-samples (github.com) Note that this does not use SQL

    0 comments No comments

  2. Ken Ekholm 151 Reputation points
    2023-03-22T10:59:43.2133333+00:00

    My goal is to send temperature data from a sensor connected to Azure Sphere MT3620 to Azure MySQL.

    I have already done this with Raspberry PI that sends sensor data directly to Azure MySQL. My goal was also to do the same thing with Azure Sphere MT3620. This would perhaps be the "easiest" way altough it is a bad solution according security.

    But I can also use Azure IoT Hub or Azure Functions if the costs isn't too high. Is there documention how to

    use Azure IoT Hub or Azure Functions with Azure MySQL?