Tutorial: Store data at the edge with SQL Server databases

LinkOne-Face Zhang-張東勝 0 Reputation points
2025-01-13T08:34:50.4833333+00:00

Hi, I have a question about this tutorial. I wonder is there any changed in the coding? I followed the instructions but I couldn't received data in sql. I found out that System.Data.SqlClient already depreciated. So I have change it to Microsoft.Data.SqlClient. However, I still face with many problems. I wonder if anyone know where the code or packages need to be revised. Thank you in advance.

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.
585 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,053 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Sander van de Velde | MVP 34,281 Reputation points MVP
    2025-01-13T15:09:30.93+00:00

    Hello @LinkOne-Face Zhang-張東勝 ,

    welcome to this moderated Azure community forum.

    it seems you try to work though this tutorial.

    In the past, I worked with SQL Server on Azure IoT Edge, as described on these blog posts (the docker image tag version should be ignored, newer versions are available).

    Regarding the two Nuget packages, it depends on which .Net version you are basing your client code (.Net 6 vs. .Net 8).

    Please have the Sql Server container running first with persisted storage on disk for the database (set in the container create options; see the blog posts).

    You also need to expose the port in the container create options if you want to provide access to the database on the local network.

    Once this is working, program against the database and move that working code to your target custom IoT Edge module.

    If you still have issues, please share details so other community members have a good impression about what is happening.


    If the response helped, do "Accept Answer". If it doesn't work, please let us know the progress. All community members with similar issues will benefit by doing so. Your contribution is highly appreciated.


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.