You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-edge/tutorial-store-data-sql-server.md
+7-37Lines changed: 7 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -171,13 +171,9 @@ The following steps show you how to create an IoT Edge function using Visual Stu
171
171
172
172
A [Deployment manifest](module-composition.md) declares which modules the IoT Edge runtime will install on your IoT Edge device. You added the code to make a customized Function module in the previous section, but the SQL Server module is already built. You just need to tell the IoT Edge runtime to include it, then configure it on your device.
173
173
174
-
1. In the Visual Studio Code explorer, open the **deployment.template.json** file.
174
+
1. In the Visual Studio Code explorer, open the **deployment.template.json** file.
175
175
2. Find the **moduleContent.$edgeAgent.properties.desired.modules** section. There should be two modules listed: **tempSensor**, which generates simulated data, and your **sqlFunction** module.
176
-
3. If you're on a Windows machine, modify the **sqlFunction.settings.image** section.
177
-
```json
178
-
"image": "${MODULES.sqlFunction.windows-amd64}"
179
-
```
180
-
1. Add the following code to declare a third module:
176
+
3. Add the following code to declare a third module:
181
177
182
178
```json
183
179
"sql": {
@@ -192,7 +188,7 @@ A [Deployment manifest](module-composition.md) declares which modules the IoT Ed
192
188
}
193
189
```
194
190
195
-
5. Depending on the operating system of your IoT Edge device, update the **sql.settings** parameters with the following code:
191
+
4. Depending on the operating system of your IoT Edge device, update the **sql.settings** parameters with the following code:
196
192
197
193
* Windows:
198
194
@@ -211,7 +207,7 @@ A [Deployment manifest](module-composition.md) declares which modules the IoT Ed
211
207
>[!Tip]
212
208
>Any time that you create a SQL Server container in a production environment, you should [change the default system administrator password](https://docs.microsoft.com/sql/linux/quickstart-install-connect-docker#change-the-sa-password).
213
209
214
-
6. Save the **deployment.template.json** file.
210
+
5. Save the **deployment.template.json** file.
215
211
216
212
## Build your IoT Edge solution
217
213
@@ -265,39 +261,13 @@ On your IoT Edge device, run the following command to see the status of the modu
265
261
iotedge list
266
262
```
267
263
268
-
## Pull SQL Container Image from Docker
269
-
270
-
Before you connect to your database, if you don't already have a container image of SQL Server Container, you can run this command to pull it from the Docker Hub. Since we are using the SQL container in this tutorial, we can't connect to the database unless we have this component present and running. Otherwise, Docker will not find a SQL container to connect to. Make sure if you're on Windows, Docker is using Windows containers, and for Linux, use Linux containers.
Afterwards, we need to run the container image with Docker.
281
-
282
-
```PowerShell
283
-
docker run -d -p 1433:1433 -e sa_password=<SA_PASSWORD> -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer
284
-
```
285
-
286
-
```bash
287
-
sudo docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=<YourStrong!Passw0rd>' \
288
-
-p 1433:1433 --name sql \
289
-
-d microsoft/mssql-server-linux:2017-latest
290
-
```
291
-
292
-
Run `iotedge list`, you should see the sql component now running with the other modules. If not, it helps to re-run the [IoT Edge runtime](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-windows-with-windows).
293
-
294
264
## Create the SQL database
295
265
296
-
When you apply the deployment manifest to your device, you get three modules running. The tempSensor module generates simulated environment data. The sqlFunction module takes the data and formats it for a database.
266
+
When you apply the deployment manifest to your device, you get three modules running. The tempSensor module generates simulated environment data. The sqlFunction module takes the data and formats it for a database.
297
267
298
-
This section guides you through setting up the SQL database to store the temperature data.
268
+
This section guides you through setting up the SQL database to store the temperature data.
299
269
300
-
1. In a command-line tool, connect to your database.
270
+
1. In a command-line too, connect to your database.
0 commit comments