Skip to content

Commit 9e9214d

Browse files
committed
More edits - working on the extension part
1 parent 5f4b113 commit 9e9214d

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

articles/iot-edge/how-to-vs-code-develop-module.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ The *iotedgedev solution init* script prompts you to complete several steps incl
190190
191191
After solution creation, these main files are in the solution:
192192
193-
- A **modules** folder.
193+
- A **.vscode** folder contains configuration file launch.json.
194+
- A **modules** folder that has subfolders for each module. Within the subfolder for each module, the module.json file controls how modules are built and deployed.
194195
- An **.env** file lists your environment variables. The environment variable for the container registry is *localhost:5000* by default. If Azure Container Registry is your registry, set an Azure Container Registry username and password. Get these values from your container registry's **Settings** > **Access keys** menu in the Azure portal. The **CONTAINER_REGISTRY_SERVER** is the **Login server** of your registry.
195196

196197
For example:
@@ -230,28 +231,32 @@ Use Visual Studio Code and the [Azure IoT Edge](https://marketplace.visualstudio
230231
1. Enter a name for your module. Choose a name that's unique within your container registry.
231232
1. Provide the name of the module's image repository. Visual Studio Code autopopulates the module name with **localhost:5000/<your module name\>**. Replace it with your own registry information. Use **localhost** if you use a local Docker registry for testing. If you use Azure Container Registry, then use **Login server** from your registry's settings. The sign-in server looks like **_\<registry name\>_.azurecr.io**. Only replace the **localhost:5000** part of the string so that the final result looks like **\<*registry name*\>.azurecr.io/_\<your module name\>_**.
232233

233-
:::image type="content" source="./media/how-to-develop-csharp-module/repository.png" alt-text="Screenshot of how to provide a Docker image repository.":::
234+
:::image type="content" source="./media/how-to-develop-csharp-module/repository.png" alt-text="Screenshot of how to provide a Docker image repository." lightbox="./media/how-to-develop-csharp-module/repository.png":::
234235

235236
Visual Studio Code takes the information you provided, creates an IoT Edge solution, and then loads it in a new window.
236237

237238
There are four items within the solution:
238239

239240
- A **.vscode** folder contains debug configurations.
240-
- A **modules** folder has subfolders for each module. Within the folder for each module, there's a file called **module.json** that controls how modules are built and deployed. You need to modify this file to change the module deployment container registry from a localhost to a remote registry. At this point, you only have one module. But you can add more if needed
241-
- An **.env** file lists your environment variables. The environment variable for the container registry is *localhost* by default. If Azure Container Registry is your registry, set an Azure Container Registry username and password. For example,
241+
- A **modules** folder has subfolders for each module. Within the folder for each module, there's a file called **module.json** that controls how modules are built and deployed. You need to modify this file to change the module deployment container registry from a localhost to a remote registry. At this point, you only have one module. But you can add more if needed.
242+
- An **.env** file lists your environment variables. The environment variable for the container registry is *localhost* by default. If Azure Container Registry is your registry, set an Azure Container Registry username and password. Get these values from your container registry's **Settings** > **Access keys** menu in the Azure portal. The **CONTAINER_REGISTRY_SERVER** is the **Login server** of your registry.
242243

243-
```env
244-
CONTAINER_REGISTRY_SERVER="myacr.azurecr.io"
245-
CONTAINER_REGISTRY_USERNAME="myacr"
246-
CONTAINER_REGISTRY_PASSWORD="<your_acr_password>"
247-
```
244+
For example:
248245

249-
In production scenarios, you should use service principals to provide access to your container registry instead of the *.env* file. For more information, see [Manage access to your container registry](production-checklist.md#manage-access-to-your-container-registry).
246+
```env
247+
CONTAINER_REGISTRY_SERVER="myacr.azurecr.io"
248+
CONTAINER_REGISTRY_USERNAME="myacr"
249+
CONTAINER_REGISTRY_PASSWORD="<my_acr_password>"
250+
```
250251

251-
> [!NOTE]
252-
> The environment file is only created if you provide an image repository for the module. If you accepted the localhost defaults to test and debug locally, then you don't need to declare environment variables.
252+
In production scenarios, you should use service principals to provide access to your container registry instead of the *.env* file. For more information, see [Manage access to your container registry](production-checklist.md#manage-access-to-your-container-registry).
253+
254+
> [!NOTE]
255+
> The environment file is only created if you provide an image repository for the module. If you accepted the localhost defaults to test and debug locally, then you don't need to declare environment variables.
253256
254-
- Two module deployment files named **deployment.template.json** and **deployment.debug.template** list the modules to deploy to your device. By default, the list includes the IoT Edge system modules and sample modules including the **SimulatedTemperatureSensor** module that simulates data you can use for testing. For more information about how deployment manifests work, see [Learn how to use deployment manifests to deploy modules and establish routes](module-composition.md). For more information on how the simulated temperature module works, see the [SimulatedTemperatureSensor.csproj source code](https://github.com/Azure/iotedge/tree/master/edge-modules/SimulatedTemperatureSensor).
257+
- Two module deployment files named **deployment.template.json** and **deployment.debug.template** list the modules to deploy to your device. By default, the list includes the IoT Edge system modules and sample modules including the **SimulatedTemperatureSensor** module that simulates data you can use for testing.
258+
259+
For more information about deployment manifests, see [Learn how to use deployment manifests to deploy modules and establish routes](module-composition.md). For more information about the simulated temperature module, see the [SimulatedTemperatureSensor.csproj source code](https://github.com/Azure/iotedge/tree/master/edge-modules/SimulatedTemperatureSensor).
255260
256261
::: zone-end
257262
@@ -265,19 +270,22 @@ The IoT Edge extension defaults to the latest stable version of the IoT Edge run
265270
1. In the command palette, enter and run the command **Azure IoT Edge: Set default IoT Edge runtime version**.
266271
1. Choose the runtime version that your IoT Edge devices are running from the list.
267272
268-
Currently, the extension doesn't include a selection for the 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 lines in the deployment manifest file:
273+
Currently, the extension doesn't include a selection for the 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 lines in the deployment manifest file:
269274

270275
```json
271276
...
272277
"systemModules": {
273278
"edgeAgent": {
274-
...
279+
...
275280
"image": "mcr.microsoft.com/azureiotedge-agent:1.4",
276-
...
281+
...
282+
}
277283
"edgeHub": {
278-
...
284+
...
279285
"image": "mcr.microsoft.com/azureiotedge-hub:1.4",
280-
...
286+
...
287+
}
288+
}
281289
```
282290

283291
1. After you select a new runtime version, your deployment manifest is dynamically updated to reflect the change to the runtime module images.

0 commit comments

Comments
 (0)