About This Page
This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.
Bias Analysis
Bias Types:
⚠️
windows_first
⚠️
powershell_heavy
⚠️
windows_tools
⚠️
missing_linux_example
Summary:
The documentation is heavily focused on Windows, specifically on deploying Azure IoT Edge for Linux on Windows (EFLOW). All device-side installation and configuration steps are provided exclusively as PowerShell commands, with no equivalent Linux-native instructions. Windows tools and patterns (e.g., Hyper-V, MSI installers, PowerShell cmdlets) are used throughout, and Linux is only referenced as the OS running inside a Windows-managed VM. Linux-native workflows, tools, or direct installation on a Linux host are not covered, and Linux command-line examples only appear after the Windows setup, for module management inside the EFLOW VM.
Recommendations:
- Provide equivalent instructions for installing and configuring Azure IoT Edge directly on a native Linux device, including supported distributions and package managers.
- Include Linux shell (bash) command examples alongside or before PowerShell commands, especially for common tasks like installation, configuration, and troubleshooting.
- Mention Linux-native virtualization/containerization options (e.g., Docker, systemd) where Hyper-V or Windows-specific features are referenced.
- Clarify in the introduction that this guide is Windows-specific, and link prominently to a Linux-native quickstart for users on Linux devices.
- Balance the order of presentation so that Linux and Windows instructions are given equal prominence, or provide a platform selection tab/switcher at the top of the page.
Create pull request
Flagged Code Snippets
1. In an elevated PowerShell session, run each of the following commands to download IoT Edge for Linux on Windows.
* **X64/AMD64**
1. Install IoT Edge for Linux on Windows on your device.
Your IoT Edge device is now configured. It's ready to run cloud-deployed modules.
## Deploy a module
Manage your Azure IoT Edge device from the cloud to deploy a module that sends telemetry data to IoT Hub.
:::image type="content" source="./media/quickstart/deploy-module.png" alt-text="Diagram that shows the step to deploy a module.":::
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 Microsoft Artifact Registry](https://mcr.microsoft.com/catalog?cat=IoT%20Edge%20Modules&alphaSort=asc&alphaSortKey=Name).
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).
Follow these steps to deploy your first module.
1. Sign in to the [Azure portal](https://portal.azure.com) and go to your IoT Hub.
1. From the menu on the left, select **Devices** under the **Device management** menu.
1. Select the device ID of the target device from the list of devices.
>[!NOTE]
>When you create a new IoT Edge device, it will display the status code `417 -- The device's deployment configuration is not set` in the Azure portal. This status is normal, and means that the device is ready to receive a module deployment.
1. On the upper bar, select **Set Modules**.
Choose which modules you want to run on your device. You can choose from modules that you've already created, modules from Microsoft Artifact Registry, or modules that you've built yourself. In this quickstart, you'll deploy a module from the Microsoft Artifact Registry.
1. In the **IoT Edge modules** section, select **Add** then choose **IoT Edge Module**.
1. Update the following module settings:
| Setting | Value |
|--------------------|----------------------------------------------------------------------|
| IoT Module name | `SimulatedTemperatureSensor` |
| Image URI | `mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:latest` |
| Restart policy | always |
| Desired status | running |
1. Select **Next: Routes** to continue to configure routes.
1. Add a route that sends all messages from the simulated temperature module to IoT Hub.
| Setting | Value |
|----------------------------------|--------------------------------------------|
| Name | `SimulatedTemperatureSensorToIoTHub` |
| Value | `FROM /messages/modules/SimulatedTemperatureSensor/* INTO $upstream` |
1. Select **Next: Review + create**.
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.
> [!NOTE]
> 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.
After you create the module deployment details, the wizard returns you to the device details page. View the deployment status on the **Modules** tab.
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.
:::image type="content" source="./media/quickstart/view-deployed-modules.png" alt-text="Screenshot that shows the SimulatedTemperatureSensor in the list of deployed modules." lightbox="./media/quickstart/view-deployed-modules.png":::
If you have issues deploying modules, see [Troubleshoot IoT Edge devices from the Azure portal](troubleshoot-in-portal.md).
## View the generated data
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.
The module that you pushed generates sample environment data that you can use for testing later. The simulated sensor is monitoring both a machine and the environment around the machine. For example, this sensor might be in a server room, on a factory floor, or on a wind turbine. The messages that it sends include ambient temperature and humidity, machine temperature and pressure, and a timestamp. IoT Edge tutorials use the data created by this module as test data for analytics.
1. Log in to your IoT Edge for Linux on Windows virtual machine using the following command in your PowerShell session:
Make sure your IoT Edge device meets the following requirements:
* System Requirements
* Windows 10<sup>1</sup>/11 (Pro, Enterprise, IoT Enterprise)
<sub><sup>1</sup> Windows 10 minimum build 17763 with all current cumulative updates installed.</sub>
* Hardware requirements
* Minimum Free Memory: 1 GB
* Minimum Free Disk Space: 10 GB
## Create an IoT hub
Start by creating an IoT hub with the Azure CLI.
:::image type="content" source="./media/quickstart/create-iot-hub.png" alt-text="Diagram that shows the step to create an I o T hub.":::
The free level of Azure IoT Hub works for this quickstart. If you've used IoT Hub in the past and already have a hub created, you can use that IoT hub.
The following code creates a free **F1** hub in the resource group `IoTEdgeResources`. Replace `{hub_name}` with a unique name for your IoT hub. It might take a few minutes to create an IoT hub.
1. Copy the value of the `connectionString` key from the JSON output and save it. This value is the device connection string. You'll use it to configure the IoT Edge runtime in the next section.
For example, your connection string should look similar to `HostName=contoso-hub.azure-devices.net;DeviceId=myEdgeDevice;SharedAccessKey=<DEVICE_SHARED_ACCESS_KEY>`.
## Install and start the IoT Edge runtime
Install IoT Edge for Linux on Windows on your device, and configure it with the device connection string.
:::image type="content" source="./media/quickstart/start-runtime.png" alt-text="Diagram that shows the step to start the I o T Edge runtime.":::
Run the following PowerShell commands on the target device where you want to deploy Azure IoT Edge for Linux on Windows. To deploy to a remote target device using PowerShell, use [Remote PowerShell](/powershell/module/microsoft.powershell.core/about/about_remote) to establish a connection to a remote device and run these commands remotely on that device.
1. In an elevated PowerShell session, run the following command to enable Hyper-V. For more information, check [Hyper-V on Windows 10](/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v).
1. Set the execution policy on the target device to `AllSigned` if it is not already. You can check the current execution policy in an elevated PowerShell prompt using:
If the execution policy of `local machine` is not `AllSigned`, you can set the execution policy using:
1. Create the IoT Edge for Linux on Windows deployment.
1. Enter 'Y' to accept the license terms.
1. Enter 'O' or 'R' to toggle **Optional diagnostic data** on or off, depending on your preference. A successful deployment is pictured below.
:::image type="content" source="./media/quickstart/successful-powershell-deployment.png" alt-text="Screenshot that show that a successful deployment will say Deployment successful at the end of the messages in the console." lightbox="./media/quickstart/successful-powershell-deployment.png":::
1. Provision your device using the device connection string that you retrieved in the previous section. Replace the placeholder text with your own value.