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/how-to-vs-code-develop-module.md
+4-58Lines changed: 4 additions & 58 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -260,60 +260,6 @@ For example:
260
260
261
261
::: zone-end
262
262
263
-
### Set IoT Edge runtime version
264
-
265
-
The IoT Edge extension defaults to the latest stable version of the IoT Edge runtime when it creates your deployment assets.
266
-
267
-
::: zone pivot="iotedge-dev-ext"
268
-
269
-
1. Select **View** > **Command Palette**.
270
-
1. In the command palette, enter and run the command **Azure IoT Edge: Set default IoT Edge runtime version**.
271
-
1. Choose the runtime version that your IoT Edge devices are running from the list.
272
-
273
-
Currently, the extension doesn't include a selection forthe latest runtime versions. If you want to set the runtime version higher than 1.2, open *deployment.debug.template.json* deployment manifest file. Change the runtime version for the system runtime module images *edgeAgent* and *edgeHub*. For example, if you want to use the IoT Edge runtime version 1.4, change the following linesin the deployment manifest file:
1. After you selecta new runtime version, your deployment manifest is dynamically updated to reflect the change to the runtime module images.
292
-
293
-
::: zone-end
294
-
295
-
::: zone pivot="iotedge-dev-cli"
296
-
297
-
1. In Visual Studio Code, open *deployment.debug.template.json* deployment manifest file. The [deployment manifest](module-deployment-monitoring.md#deployment-manifest) is a JSON document that describes the modules to be configured on the targeted IoT Edge device.
298
-
1. Change the runtime version forthe system runtime module images *edgeAgent* and *edgeHub*. For example, if you want to use the IoT Edge runtime version 1.4, change the following linesin the deployment manifest file:
You might have to change your `.env` file for the variable `RUNTIME_TAG`, instead of changing the manifest.
314
-
315
-
::: zone-end
316
-
317
263
## Add more modules
318
264
319
265
To add more modules to your solution, change to the *modules* directory and add them there.
@@ -573,7 +519,7 @@ In each module folder, there are several Docker files for different container ty
573
519
When you debug modules using this method, your modules are running on top of the IoT Edge runtime. The IoT Edge device and your Visual Studio Code can be on the same machine, or more typically, Visual Studio Code is on the development machine and the IoT Edge runtime and modules are running on another physical machine. In order to debug from Visual Studio Code, you must:
574
520
575
521
- Set up your IoT Edge device, build your IoT Edge modules with the **.debug** Dockerfile, and then deploy to the IoT Edge device.
576
-
- Update the `launch.json` so that Visual Studio Code can attach to the process in the container on the remote machine. You can find this file in the `.vscode` folder in your workspace and updates each time you add a new module that supports debugging.
522
+
- Update `launch.json` so that Visual Studio Code can attach to the process ina container on the remote machine. You can find this file in the `.vscode` folder in your workspace, and it updates each time you add a new module that supports debugging.
577
523
- Use Remote SSH debugging to attach to the container on the remote machine.
578
524
579
525
### Build and deploy your module to an IoT Edge device
@@ -632,12 +578,12 @@ In Visual Studio Code, open the *deployment.debug.template.json* deployment mani
632
578
633
579
1. In the Visual Studio Code command palette, run the command **Azure IoT Edge: Build and Push IoT Edge solution**.
634
580
1. Select the `deployment.debug.template.json` file for your solution.
635
-
1. In the **Azure IoT HubDevices** section of the Visual Studio Code Explorer view, right-click the IoT Edge device name for deployment and then choose **Create Deployment for Single Device**.
581
+
1. In the **Azure IoT Hub** > **Devices** section of the Visual Studio Code Explorer view, right-click the IoT Edge device name for deployment and then choose **Create Deployment for Single Device**.
636
582
> [!TIP]
637
583
> To confirm that the device you've chosen is an IoT Edge device, selectit to expand the list of modules and verify the presence of **$edgeHub** and **$edgeAgent**. Every IoT Edge device includes these two modules.
638
584
1. Navigate to your solution's **config** folder, select the `deployment.debug.amd64.json` file, and then select **Select Edge Deployment Manifest**.
639
585
640
-
You can check your container status by running the `docker ps`commandinthe terminal. If your Visual Studio Code and IoT Edge runtime are running on the same machine, you can also check the status in the Visual Studio Code Docker view.
586
+
You can check your container status from your device or virtual machine by running the `docker ps` command in a terminal. You should see your container listed after running the command. If your Visual Studio Code and IoT Edge runtime are running on the same machine, you can also check the status in the Visual Studio Code Docker view.
641
587
642
588
> [!IMPORTANT]
643
589
> If you're using a private registry like Azure Container Registry (ACR) for your images, you may need to authenticate to push images. Use `docker login <ACR login server>` or `az acr login --name <ACR name>` to authenticate.
@@ -811,7 +757,7 @@ The Docker and Moby engines support SSH connections to containers allowing you t
811
757
1. In Visual Studio Code, set breakpoints in your custom module.
812
758
1. When a breakpoint is hit, you can inspect variables, step through code, and debug your module.
813
759
814
-
:::image type="content" source="media/how-to-vs-code-develop-module/vs-code-breakpoint.png" alt-text="Screenshot of Visual Studio Code attached to a Docker container on a remote device paused at a breakpoint.":::
760
+
:::image type="content" source="media/how-to-vs-code-develop-module/vs-code-breakpoint.png" alt-text="Screenshot of Visual Studio Code attached to a Docker container on a remote device paused at a breakpoint." lightbox="media/how-to-vs-code-develop-module/vs-code-breakpoint.png":::
815
761
> [!NOTE]
816
762
> The preceding example shows how to debug IoT Edge modules on remote containers. The example adds a remote Docker context and changes to the Docker privileges on the remote device. After you finish debugging your modules, set your Docker context to *default* and remove privileges from your user account.
0 commit comments