Skip to content

Commit 52fe7a2

Browse files
Merge pull request #270424 from PatAltimore/patricka-uuf-quickstart
Add feedback and clean up IoT Edge quickstart
2 parents 2404a19 + 9239299 commit 52fe7a2

9 files changed

+45
-69
lines changed
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
23.2 KB
Loading

articles/iot-edge/quickstart-linux.md

Lines changed: 29 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Quickstart creates an Azure IoT Edge device on Linux
33
description: Learn how to create an IoT Edge device on Linux and then deploy prebuilt code remotely from the Azure portal.
44
author: PatAltimore
55
ms.author: patricka
6-
ms.date: 07/18/2023
6+
ms.date: 03/27/2024
77
ms.topic: quickstart
88
ms.service: iot-edge
99
services: iot-edge
@@ -83,7 +83,7 @@ Since IoT Edge devices behave and can be managed differently than typical IoT de
8383
az iot hub device-identity connection-string show --device-id myEdgeDevice --hub-name {hub_name}
8484
```
8585

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>`.
8787

8888
## Configure your IoT Edge device
8989

@@ -99,18 +99,18 @@ During the runtime configuration, you provide a device connection string. This i
9999

100100
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.
101101

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.
103103

104104
* Deploy using the IoT Edge Azure Resource Manager template.
105105

106-
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedge-vm-deploy%2Fmaster%2FedgeDeploy.json)
106+
[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure%2Fiotedge-vm-deploy%2Fmain%2FedgeDeploy.json)
107107

108108
* 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:
109109

110110
```azurecli-interactive
111111
az deployment group create \
112112
--resource-group IoTEdgeResources \
113-
--template-uri "https://raw.githubusercontent.com/Azure/iotedge-vm-deploy/1.4/edgeDeploy.json" \
113+
--template-uri "https://raw.githubusercontent.com/Azure/iotedge-vm-deploy/main/edgeDeploy.json" \
114114
--parameters dnsLabelPrefix='<REPLACE_WITH_VM_NAME>' \
115115
--parameters adminUsername='azureUser' \
116116
--parameters deviceConnectionString=$(az iot hub device-identity connection-string show --device-id myEdgeDevice --hub-name <REPLACE_WITH_HUB_NAME> -o tsv) \
@@ -123,7 +123,7 @@ Use the **Deploy to Azure** button or the CLI commands to create your IoT Edge d
123123
```azurecli
124124
az deployment group create `
125125
--resource-group IoTEdgeResources `
126-
--template-uri "https://raw.githubusercontent.com/Azure/iotedge-vm-deploy/1.4/edgeDeploy.json" `
126+
--template-uri "https://raw.githubusercontent.com/Azure/iotedge-vm-deploy/main/edgeDeploy.json" `
127127
--parameters dnsLabelPrefix='<REPLACE_WITH_VM_NAME>' `
128128
--parameters adminUsername='azureUser' `
129129
--parameters deviceConnectionString=$(az iot hub device-identity connection-string show --device-id myEdgeDevice --hub-name <REPLACE_WITH_HUB_NAME> -o tsv) `
@@ -143,9 +143,7 @@ This template takes the following parameters:
143143
| **authenticationType** | The authentication method for the admin account. This quickstart uses **password** authentication, but you can also set this parameter to **sshPublicKey**. |
144144
| **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. |
145145

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]`.
149147

150148
### View the IoT Edge runtime status
151149

@@ -188,7 +186,7 @@ Manage your Azure IoT Edge device from the cloud to deploy a module that will se
188186

189187
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.
190188

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).
192190

193191
Follow these steps to start the **Set Modules** wizard to deploy your first module from Azure Marketplace.
194192

@@ -202,43 +200,31 @@ Follow these steps to start the **Set Modules** wizard to deploy your first modu
202200

203201
1. On the upper bar, select **Set Modules**.
204202

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.
214204

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**.
216206

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.
218208

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.
220210

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.
222212

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**.
224214

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.
226216

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.
235219
236220
After you create the module deployment details, the wizard returns you to the device details page. View the deployment status on the **Modules** tab.
237221

238222
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.
239223

240224
:::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":::
241225

226+
If you have issues deploying modules, see [Troubleshoot IoT Edge devices from the Azure portal](troubleshoot-in-portal.md).
227+
242228
## View generated data
243229

244230
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
247233

248234
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:
249235

250-
```bash
251-
sudo iotedge list
252-
```
236+
```bash
237+
sudo iotedge list
238+
```
253239

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":::
255241

256242
View the messages being sent from the temperature sensor module:
257243

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+
```
264247

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":::
266249

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.
268252
269253
## Clean up resources
270254

0 commit comments

Comments
 (0)