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/quickstart-linux.md
+29-45Lines changed: 29 additions & 45 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Quickstart creates an Azure IoT Edge device on Linux
3
3
description: Learn how to create an IoT Edge device on Linux and then deploy prebuilt code remotely from the Azure portal.
4
4
author: PatAltimore
5
5
ms.author: patricka
6
-
ms.date: 07/18/2023
6
+
ms.date: 03/27/2024
7
7
ms.topic: quickstart
8
8
ms.service: iot-edge
9
9
services: iot-edge
@@ -83,7 +83,7 @@ Since IoT Edge devices behave and can be managed differently than typical IoT de
83
83
az iot hub device-identity connection-string show --device-id myEdgeDevice --hub-name {hub_name}
84
84
```
85
85
86
-
:::image type="content" source="./media/quickstart/retrieve-connection-string.png" alt-text="Screenshot of the connection string from CLI output." lightbox="./media/quickstart/retrieve-connection-string.png":::
86
+
For example, your connection string should look similar to `HostName=contoso-hub.azure-devices.net;DeviceId=myEdgeDevice;SharedAccessKey=<DEVICE_SHARED_ACCESS_KEY>`.
87
87
88
88
## Configure your IoT Edge device
89
89
@@ -99,18 +99,18 @@ During the runtime configuration, you provide a device connection string. This i
99
99
100
100
This section uses an Azure Resource Manager template to create a new virtual machine and install the IoT Edge runtime on it. If you want to use your own Linux device instead, you can follow the installation steps in [Manually provision a single Linux IoT Edge device](how-to-provision-single-device-linux-symmetric.md), then return to this quickstart.
101
101
102
-
Use the **Deploy to Azure** button or the CLI commands to create your IoT Edge device based on the prebuilt [iotedge-vm-deploy](https://github.com/Azure/iotedge-vm-deploy/tree/1.4) template.
102
+
Use the **Deploy to Azure** button or the CLI commands to create your IoT Edge device based on the prebuilt [iotedge-vm-deploy](https://github.com/Azure/iotedge-vm-deploy) template.
103
103
104
104
* Deploy using the IoT Edge Azure Resource Manager template.
105
105
106
-
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedge-vm-deploy%2Fmaster%2FedgeDeploy.json)
106
+
[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedge-vm-deploy%2Fmain%2FedgeDeploy.json)
107
107
108
108
* For bash or Cloud Shell users, copy the following command into a text editor, replace the placeholder text with your information, then copy into your bash or Cloud Shell window:
@@ -143,9 +143,7 @@ This template takes the following parameters:
143
143
|**authenticationType**| The authentication method for the admin account. This quickstart uses **password** authentication, but you can also set this parameter to **sshPublicKey**. |
144
144
|**adminPasswordOrKey**| The password or value of the SSH key for the admin account. Replace the placeholder text with a secure password. Your password must be at least 12 characters long and have three of four of the following: lowercase characters, uppercase characters, digits, and special characters. |
145
145
146
-
Once the deployment is complete, you should receive JSON-formatted output in the CLI that contains the SSH information to connect to the virtual machine. Copy the value of the **public SSH** entry of the **outputs** section:
147
-
148
-
:::image type="content" source="./media/quickstart-linux/outputs-public-ssh.png" alt-text="Screenshot showing how to retrieve public ssh value from output." lightbox="./media/quickstart-linux/outputs-public-ssh.png":::
146
+
Once the deployment is complete, you should receive JSON-formatted output in the CLI that contains the SSH information to connect to the virtual machine. Copy the value of the **public SSH** entry of the **outputs** section. For example, your SSH command should look similar to `ssh [email protected]`.
149
147
150
148
### View the IoT Edge runtime status
151
149
@@ -188,7 +186,7 @@ Manage your Azure IoT Edge device from the cloud to deploy a module that will se
188
186
189
187
One of the key capabilities of Azure IoT Edge is deploying code to your IoT Edge devices from the cloud. *IoT Edge modules* are executable packages implemented as containers. In this section, you'll deploy a pre-built module from the [IoT Edge Modules section of Azure Marketplace](https://azuremarketplace.microsoft.com/marketplace/apps/category/internet-of-things?page=1&subcategories=iot-edge-modules) directly from Azure IoT Hub.
190
188
191
-
The module that you deploy in this section simulates a sensor and sends generated data. This module is a useful piece of code when you're getting started with IoT Edge because you can use the simulated data for development and testing. If you want to see exactly what this module does, you can view the [simulated temperature sensor source code](https://github.com/Azure/iotedge/blob/027a509549a248647ed41ca7fe1dc508771c8123/edge-modules/SimulatedTemperatureSensor/src/Program.cs).
189
+
The module that you deploy in this section simulates a sensor and sends generated data. This module is a useful piece of code when you're getting started with IoT Edge because you can use the simulated data for development and testing. If you want to see exactly what this module does, you can view the [simulated temperature sensor source code](https://github.com/Azure/iotedge/blob/main/edge-modules/SimulatedTemperatureSensor/src/Program.cs).
192
190
193
191
Follow these steps to start the **Set Modules** wizard to deploy your first module from Azure Marketplace.
194
192
@@ -202,43 +200,31 @@ Follow these steps to start the **Set Modules** wizard to deploy your first modu
202
200
203
201
1. On the upper bar, select **Set Modules**.
204
202
205
-
:::image type="content" source="./media/quickstart-linux/select-set-modules.png" alt-text="Screenshot that shows location of the Set Modules tab.":::
206
-
207
-
### Modules
208
-
209
-
The first step of the wizard is to choose which modules you want to run on your device.
210
-
211
-
Under **IoT Edge Modules**, open the **Add** drop-down menu, and then select **Marketplace Module**.
212
-
213
-
:::image type="content" source="./media/quickstart-linux/add-marketplace-module.png" alt-text="Screenshot that shows the Add drop-down menu.":::
203
+
Choose which modules you want to run on your device. You can choose from modules that you've already created, modules from Azure Marketplace, or modules that you've built yourself. In this quickstart, you'll deploy a module from Azure Marketplace.
214
204
215
-
In **IoT Edge Module Marketplace**, search for and select the `Simulated Temperature Sensor` module. The module is added to the IoT Edge Modules section with the desired **running** status.
205
+
1. Under **IoT Edge Modules**, open the **Add** drop-down menu, and then select **Marketplace Module**.
216
206
217
-
Select **Next: Routes** to continue to the next step of the wizard.
207
+
1. In **IoT Edge Module Marketplace**, search for and select the `Simulated Temperature Sensor` module. The module is added to the IoT Edge Modules section with the desired **running** status.
218
208
219
-
:::image type="content" source="./media/quickstart-linux/view-temperature-sensor-next-routes.png" alt-text="Screenshot that shows continuing to the next step after the module is added.":::
209
+
1. Select **Next: Routes**to continue to configure routes.
220
210
221
-
### Routes
211
+
A route named *SimulatedTemperatureSensorToIoTHub* was created automatically when you added the module from Azure Marketplace. This route sends all messages from the simulated temperature module to IoT Hub.
222
212
223
-
A route named *SimulatedTemperatureSensorToIoTHub* was created automatically when you added the module from Azure Marketplace. This route sends all messages from the simulated temperature module to IoT Hub.
213
+
1. Select **Next: Review + create**.
224
214
225
-
:::image type="content" source="./media/quickstart-linux/route-next-review-create.png" alt-text="Screenshot that shows the new temperature sensor route and shows the location of the Next: Review + create button.":::
215
+
1. Review the JSON file, and then select **Create**. The JSON file defines all of the modules that you deploy to your IoT Edge device.
226
216
227
-
Select **Next: Review + create**.
228
-
229
-
### Review and create
230
-
231
-
Review the JSON file, and then select **Create**. The JSON file defines all of the modules that you deploy to your IoT Edge device.
232
-
233
-
>[!Note]
234
-
>When you submit a new deployment to an IoT Edge device, nothing is pushed to your device. Instead, the device queries IoT Hub regularly for any new instructions. If the device finds an updated deployment manifest, it uses the information about the new deployment to pull the module images from the cloud then starts running the modules locally. This process can take a few minutes.
217
+
> [!NOTE]
218
+
> When you submit a new deployment to an IoT Edge device, nothing is pushed to your device. Instead, the device queries IoT Hub regularly for any new instructions. If the device finds an updated deployment manifest, it uses the information about the new deployment to pull the module images from the cloud then starts running the modules locally. This process can take a few minutes.
235
219
236
220
After you create the module deployment details, the wizard returns you to the device details page. View the deployment status on the **Modules** tab.
237
221
238
222
You should see three modules: **$edgeAgent**, **$edgeHub**, and **SimulatedTemperatureSensor**. If one or more of the modules has **Yes** under **Specified in Deployment** but not under **Reported by Device**, your IoT Edge device is still starting them. Wait a few minutes, and then refresh the page.
239
223
240
224
:::image type="content" source="./media/quickstart-linux/view-deployed-modules.png" alt-text="Screenshot that shows the SimulatedTemperatureSensor in the list of deployed modules." lightbox="./media/quickstart-linux/view-deployed-modules.png":::
241
225
226
+
If you have issues deploying modules, see [Troubleshoot IoT Edge devices from the Azure portal](troubleshoot-in-portal.md).
227
+
242
228
## View generated data
243
229
244
230
In this quickstart, you created a new IoT Edge device and installed the IoT Edge runtime on it. Then, you used the Azure portal to deploy an IoT Edge module to run on the device without having to make changes to the device itself.
@@ -247,24 +233,22 @@ In this case, the module that you pushed generates sample environment data that
247
233
248
234
Open the command prompt on your IoT Edge device again, or use the SSH connection from Azure CLI. Confirm that the module deployed from the cloud is running on your IoT Edge device:
249
235
250
-
```bash
251
-
sudo iotedge list
252
-
```
236
+
```bash
237
+
sudo iotedge list
238
+
```
253
239
254
-
:::image type="content" source="./media/quickstart-linux/iot-edge-list-2-version-1.4.png" alt-text="Screenshot that shows three modules on your device." lightbox="./media/quickstart-linux/iot-edge-list-2-version-1.4.png":::
240
+
:::image type="content" source="./media/quickstart-linux/iot-edge-list.png" alt-text="Screenshot that shows three modules on your device." lightbox="./media/quickstart-linux/iot-edge-list.png":::
255
241
256
242
View the messages being sent from the temperature sensor module:
257
243
258
-
```bash
259
-
sudo iotedge logs SimulatedTemperatureSensor -f
260
-
```
261
-
262
-
>[!TIP]
263
-
>IoT Edge commands are case-sensitive when referring to module names.
244
+
```bash
245
+
sudo iotedge logs SimulatedTemperatureSensor -f
246
+
```
264
247
265
-
:::image type="content" source="./media/quickstart-linux/iot-edge-logs.png" alt-text="Screenshot that shows data from your module in the output console." lightbox="./media/quickstart-linux/iot-edge-logs.png":::
248
+
:::image type="content" source="./media/quickstart-linux/iot-edge-logs.png" alt-text="Screenshot that shows data from your module in the output console." lightbox="./media/quickstart-linux/iot-edge-logs.png":::
266
249
267
-
You can also watch the messages arrive at your IoT hub by using the [Azure IoT Hub extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=vsciot-vscode.azure-iot-toolkit).
250
+
>[!TIP]
251
+
>IoT Edge commands are case-sensitive when referring to module names.
0 commit comments