### Example downstream configuration file Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-connect-downstream-iot-edge-device This is an example of how the beginning of your downstream configuration file should look after applying the necessary updates. ```toml parent_hostname = "10.0.0.4" trust_bundle_cert = "file:///var/aziot/certs/azure-iot-test-only.root.ca.cert.pem" [edge_ca] cert = "file:///var/aziot/certs/iot-device-downstream-full-chain.cert.pem" pk = "file:///var/aziot/secrets/iot-device-downstream.key.pem" ``` -------------------------------- ### Example of monitoring IoT Hub events Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge This is an example of the command to monitor events for a specific IoT Hub and device. ```bash az iot hub monitor-events -n my-iot-hub -d child-1 ``` -------------------------------- ### Install usbipd-win using Windows Package Manager Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-connect-usb-devices Use winget to install the usbipd-win project. If you don't use the `--interactive` parameter, winget may restart your computer if needed to install drivers. ```bash winget install --interactive --exact dorssel.usbipd-win ``` -------------------------------- ### Deploy IoT Edge for Linux on Windows Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-on-windows-symmetric Creates the Linux virtual machine and installs the IoT Edge runtime. This command is essential for the initial setup after installation. ```powershell Deploy-Eflow ``` -------------------------------- ### Install IoT Edge runtime via snap Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-symmetric Installs the Azure IoT Edge runtime from the snap store. This is a convenient method for installing the latest version. ```bash sudo snap install azure-iot-edge ``` -------------------------------- ### Example parent configuration file Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-connect-downstream-iot-edge-device This example shows the beginning of a parent configuration file with essential parameters like hostname, trust bundle certificate, and Edge CA configuration. ```toml hostname = "10.0.0.4" trust_bundle_cert = "file:///var/aziot/certs/azure-iot-test-only.root.ca.cert.pem" [edge_ca] cert = "file:///var/aziot/certs/iot-edge-device-ca-gateway-full-chain.cert.pem" pk = "file:///var/aziot/secrets/iot-edge-device-ca-gateway.key.pem" ``` -------------------------------- ### Example module configuration in deployment manifest Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-deploy-custom-vision This example shows the configuration for the 'classifier' and 'cameracapture' modules within the 'modules' section of the deployment manifest, including their settings and create options. ```json "modules": { "classifier": { "version": "1.0", "type": "docker", "status": "running", "restartPolicy": "always", "settings": { "image": "${MODULES.classifier}", "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}" } }, "cameracapture": { "version": "1.0", "type": "docker", "status": "running", "restartPolicy": "always", "settings": { "image": "${MODULES.cameracapture}", "createOptions": "{\"Env\":[\"IMAGE_PATH=test_image.jpg\",\"IMAGE_PROCESSING_ENDPOINT=http://classifier/image\"]}" } } } ``` -------------------------------- ### Install or Upgrade IoT Edge (apt) Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-update-iot-edge Install or upgrade the `aziot-edge` package on Ubuntu/Debian systems. This command also installs the `aziot-identity-service` as a dependency. ```Bash sudo apt-get install aziot-edge ``` -------------------------------- ### Run install script to apply configuration Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge Execute the install script with root privileges to apply the configuration bundle to the device. This command should be run on each device after extracting the bundle. ```bash sudo ./install.sh ``` -------------------------------- ### Start IoT Edge Hub Simulator for Single Module Source: https://learn.microsoft.com/en-us/azure/iot-edge/debug-module-vs-code Use this command to start the IoT Edge simulator for a single module. Provide input names to test with your module. ```bash D:\Workspaces\EdgeSolution>iotedgehubdev start -i "input1" ... ``` -------------------------------- ### Example: Create a two-device hierarchy Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge This example demonstrates creating a parent device named 'parent-1' and a child device named 'child-1', saving their configuration bundles to the 'output' directory. It also generates self-signed certificates. ```azurecli az iot edge devices create \ --hub-name my-iot-hub \ --output-path ./output \ --default-edge-agent "mcr.microsoft.com/azureiotedge-agent:1.5" \ --device id=parent-1 \ deployment=./deploymentTopLayer.json \ hostname=10.0.0.4 \ --device id=child-1 \ parent=parent-1 \ deployment=./deploymentLowerLayer.json \ hostname=10.1.0.4 ``` -------------------------------- ### Install TPM2 Tools on Ubuntu Core snaps Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-tpm Installs the TPM2 Tools package on Ubuntu Core using snaps. ```bash sudo snap install tpm2-tools ``` -------------------------------- ### Example filtermodule configuration with createOptions Source: https://learn.microsoft.com/en-us/azure/iot-edge/debug-module-vs-code An example of a custom module configuration within the deployment manifest, including image details and port bindings via `createOptions`. ```json "filtermodule": { "version": "1.0", "type": "docker", "status": "running", "restartPolicy": "always", "settings": { "image": "myacr.azurecr.io/filtermodule:0.0.1-amd64", "createOptions": "{\"HostConfig\":{\"PortBindings\":{\"5671/tcp\":[{\"HostPort\":\"5671\"}],\"8883/tcp\":[{\"HostPort\":\"8883\"}],\"443/tcp\":[{\"HostPort\":\"443\"}]}}" } } ``` -------------------------------- ### Run IoT Edge installation script Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge-for-linux-on-windows Executes the IoT Edge installation script with superuser privileges. This applies the configuration bundle to the device. ```bash sudo sh ./install.sh ``` -------------------------------- ### Example Certificate File Listing Source: https://learn.microsoft.com/en-us/azure/iot-edge/iot-edge-certs This is an example output of the `ls -l` command showing certificate files stored in the IoT Edge cert directory. File names include hashes and types. ```text total 24 -rw-r--r-- 1 aziotcs aziotcs 1090 Jul 27 21:27 aziotedgedca-86f154be7ff14480027f0d00c59c223db6d9e4ab0b559fc523cca36a7c973d6d.cer -rw-r--r-- 1 aziotcs aziotcs 2589 Jun 22 18:25 aziotedgedmoduleIoTEdgeAPIProxy637913460334654299server-c7066944a8d35ca97f1e7380ab2afea5068f39a8112476ffc89ea2c46ca81d10.cer -rw-r--r-- 1 aziotcs aziotcs 2576 Jun 22 18:25 aziotedgedmoduleedgeHub637911101449272999server-a0407493b6b50ee07b3fedbbb9d181e7bb5f6f52c1d071114c361aca628daa92.cer -rw-r--r-- 1 aziotcs aziotcs 1450 Jul 27 21:27 deviceid-bd732105ef89cf8edd2606a5309c8a26b7b5599a4e124a0fe6199b6b2f60e655.cer ``` -------------------------------- ### Example JSON output for device connection string Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-single-device-linux-on-windows-symmetric This is an example of the JSON output you will see when retrieving a device's connection string using the Azure CLI. ```json { "connectionString": "HostName=[hub_name].azure-devices.net;DeviceId=[device_id];SharedAccessKey=[device_key]" } ``` -------------------------------- ### Example eth0 Network Interface Output Source: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot-iot-edge-for-linux-on-windows-networking This is an example output from the 'ifconfig eth0' command, showing the network configuration details for the 'eth0' interface, including the 'inet' IP address, netmask, and broadcast address. ```text eth0: flags=4163 mtu 1500 inet 172.31.100.171 netmask 255.255.240.0 broadcast 172.31.111.255 inet6 fe80::215:5dff:fe2a:2f62 prefixlen 64 scopeid 0x20 ether 00:15:5d:2a:2f:62 txqueuelen 1000 (Ethernet) RX packets 115746 bytes 11579209 (11.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 976 bytes 154184 (150.5 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ``` -------------------------------- ### Install IoT Edge runtime (Ubuntu/Debian) Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-single-device-linux-symmetric Installs a specific version of the IoT Edge runtime on Ubuntu/Debian systems using a downloaded .deb package. Replace `` with the actual download URL. ```bash curl -L -o aziot-edge.deb && sudo apt-get install ./aziot-edge.deb ``` -------------------------------- ### Install IoT Edge for Linux on Windows with PowerShell Source: https://learn.microsoft.com/en-us/azure/iot-edge/quickstart Execute this command in an elevated PowerShell session to silently install the downloaded IoT Edge for Linux on Windows MSI package. ```powershell Start-Process -Wait msiexec -ArgumentList "/i","$([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi'))","/qn" ``` -------------------------------- ### Metric Selector Syntax Example Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-collect-and-transport-metrics This example demonstrates the syntax for a metric selector, including metric name, label-based selectors, and endpoint selectors. Metric names support wildcards. ```bash metricToSelect{quantile=0.5,otherLabel=~Re[ge]*|x}[http://VeryNoisyModule:9001/metrics] ``` -------------------------------- ### Download IoT Edge MSI installer (X64/AMD64) with PowerShell Source: https://learn.microsoft.com/en-us/azure/iot-edge/quickstart This PowerShell command downloads the IoT Edge for Linux on Windows MSI installer for X64/AMD64 architecture. The download progress is set to silently continue. ```powershell $msiPath = $([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi')) $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest "https://aka.ms/AzEFLOWMSI_1_5_LTS_X64" -OutFile $msiPath ``` -------------------------------- ### Download IoT Edge MSI installer (ARM64) with PowerShell Source: https://learn.microsoft.com/en-us/azure/iot-edge/quickstart This PowerShell command downloads the IoT Edge for Linux on Windows MSI installer for ARM64 architecture. The download progress is set to silently continue. ```powershell $msiPath = $([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi')) $ProgressPreference = 'SilentlyContinue' Invoke-WebRequest "https://aka.ms/AzEFLOWMSI_1_5_LTS_ARM64" -OutFile $msiPath ``` -------------------------------- ### Create and configure manual provisioning file Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-single-device-linux-symmetric Create a `config.toml` file in your home directory for manual provisioning with symmetric key authentication. This file specifies the provisioning source and connection string. ```bash sudo nano ~/config.toml ``` ```toml [provisioning] source = "manual" connection_string = "REPLACE_WITH_DEVICE_CONNECTION_STRING" ``` -------------------------------- ### Check DHCP Server Installation Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-create-virtual-switch Use this command to verify if the DHCP Server feature is already installed on the host machine. If 'Installed' is shown, you can skip the installation step. ```PowerShell Get-WindowsFeature -Name 'DHCP' ``` -------------------------------- ### Deploy End-to-End Tutorial Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-observability Execute the 'deploy-e2e-tutorial.ps1' script using PowerShell to deploy the IoT Edge logging and monitoring solution. ```powershell ./Scripts/deploy-e2e-tutorial.ps1 ``` -------------------------------- ### Install Moby engine on Ubuntu/Debian Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-symmetric Installs the Moby container engine on Ubuntu or Debian-based systems. Ensure your system is updated before installation. ```bash sudo apt-get update; \ sudo apt-get install moby-engine ``` -------------------------------- ### Verify NVIDIA Driver Installation Source: https://learn.microsoft.com/en-us/azure/iot-edge/configure-connect-verify-gpu Run this command after installing NVIDIA drivers to confirm the installation. A table displaying GPU information should appear. ```bash nvidia-smi ``` -------------------------------- ### Start EFLOW VM Source: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot-iot-edge-for-linux-on-windows Use this cmdlet to start the EFLOW virtual machine if it is stopped. Ensure the WSSDAgent service is running before attempting to start the VM. ```powershell Start-EflowVm ``` -------------------------------- ### Create directories and set permissions for certificates and keys Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-manage-device-certificates Use these commands to create the necessary directories and set appropriate ownership and permissions for certificate and private key files on the IoT Edge device. ```bash sudo mkdir -p /var/aziot/certs sudo chown aziotcs:aziotcs /var/aziot/certs sudo chmod 755 /var/aziot/certs sudo mkdir -p /var/aziot/secrets sudo chown aziotks:aziotks /var/aziot/secrets sudo chmod 700 /var/aziot/secrets # Copy certificate and private key into the correct directory sudo cp my-cert.pem /var/aziot/certs sudo cp my-private-key.pem /var/aziot/secrets ``` -------------------------------- ### Create and Set Permissions for IoT Edge Certificate Directories Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-manage-device-certificates Use these commands to create the certificate and key directories, set their ownership to the appropriate users (aziotcs and aziotks), and configure the required permissions. ```bash sudo mkdir -p /var/aziot/certs sudo chown aziotcs:aziotcs /var/aziot/certs sudo chmod 755 /var/aziot/certs sudo mkdir -p /var/aziot/secrets sudo chown aziotks:aziotks /var/aziot/secrets sudo chmod 700 /var/aziot/secrets # Give aziotcs ownership to certificates # Read and write for aziotcs, read-only for others sudo chown -R aziotcs:aziotcs /var/aziot/certs sudo find /var/aziot/certs -type f -name "*.*" -exec chmod 644 {} \; # Give aziotks ownership to private keys # Read and write for aziotks, no permission for others sudo chown -R aziotks:aziotks /var/aziot/secrets sudo find /var/aziot/secrets -type f -name "*.*" -exec chmod 600 {} \; # Verify permissions of directories and files sudo ls -Rla /var/aziot ``` -------------------------------- ### Install NVIDIA Utilities on Ubuntu Source: https://learn.microsoft.com/en-us/azure/iot-edge/configure-connect-verify-gpu Install the NVIDIA System Management Interface (nvidia-smi) package on Ubuntu 22.04. This command installs version 535 of the utilities. ```bash sudo apt install nvidia-utils-535 ``` -------------------------------- ### Connect to your virtual machine Source: https://learn.microsoft.com/en-us/azure/iot-edge/quickstart-linux Use this command to connect to your virtual machine. Replace placeholders with your specific values. ```bash ssh @ ``` -------------------------------- ### Install OpenSSL on Windows using vcpkg Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-create-test-certificates Use this PowerShell command to install the OpenSSL package for Windows x64 via vcpkg. Ensure vcpkg is installed and in your PATH. ```powershell .\vcpkg install openssl:x64-windows ``` -------------------------------- ### IoT Hub provisioning configuration example Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-manage-device-certificates This TOML snippet shows the configuration for manual provisioning when using IoT Hub, specifying the provisioning source. ```toml [provisioning] source = "manual" ``` -------------------------------- ### Install IoT Edge with Custom Directories Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-on-windows-symmetric Installs IoT Edge for Linux on Windows with custom installation and VHDX directories. Use fully qualified paths for INSTALLDIR and VHDXDIR. ```powershell Start-Process -Wait msiexec -ArgumentList "/i","$([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi'))","/qn","INSTALLDIR=D:\EFLOW", "VHDXDIR=D:\EFLOW-VHDX" ``` -------------------------------- ### Start-EflowVm Source: https://learn.microsoft.com/en-us/azure/iot-edge/reference-iot-edge-for-linux-on-windows-functions Starts the virtual machine. If the virtual machine is already started, no action is taken. ```APIDOC ## Start-EflowVm The **Start-EflowVm** command starts the virtual machine. If the virtual machine is already started, no action is taken. ``` -------------------------------- ### Install TPM2 Tools on Ubuntu/Debian Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-tpm Installs the TPM2 Tools package on Ubuntu or Debian-based systems. ```bash sudo apt-get install tpm2-tools ``` -------------------------------- ### Build Module Docker Image Examples Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-visual-studio-develop-module Examples of building a Docker image for an IoT Edge module. One command builds for a local registry, and the other builds for an Azure Container Registry. Ensure the Dockerfile path, image name, and context path are correctly specified. ```bash # Build the image for the local registry docker build --rm -f "./IotEdgeModule1/Dockerfile.amd64.debug" -t localhost:5000/iotedgemodule1:0.0.1-amd64 "./IotEdgeModule1" # Or build the image for an Azure Container Registry docker build --rm -f "./IotEdgeModule1/Dockerfile.amd64.debug" -t myacr.azurecr.io/iotedgemodule1:0.0.1-amd64 "./IotEdgeModule1" ``` -------------------------------- ### Install Azure CLI IoT Extension Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-ubuntuvm Installs the necessary IoT extension for the Azure CLI. ```bash az extension add --name azure-iot ``` -------------------------------- ### Create directories and set permissions for certificates and keys (Linux) Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway Use these commands to create the necessary directories for certificates and keys on an IoT Edge device and set the correct ownership and permissions. This ensures the IoT Edge security daemon can access them. ```Bash sudo mkdir -p /var/aziot/certs sudo chown aziotcs:aziotcs /var/aziot/certs sudo chmod 755 /var/aziot/certs sudo mkdir -p /var/aziot/secrets sudo chown aziotks:aziotks /var/aziot/secrets sudo chmod 700 /var/aziot/secrets ``` -------------------------------- ### Example SHA256 Thumbprint Output Source: https://learn.microsoft.com/en-us/azure/iot-edge/iot-edge-certs This is an example of the output format for the SHA256 thumbprint when retrieved using the openssl command. ```text SHA256 Fingerprint=1E:F3:1F:88:24:74:2C:4A:C1:A7:FA:EC:5D:16:C4:11:CD:85:52:D0:88:3E:39:CB:7F:17:53:40:9C:02:95:C3 ``` -------------------------------- ### Create and Set Permissions for Certificate Directories Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-connect-downstream-iot-edge-device Creates directories for device certificates and secrets, sets ownership to 'aziotcs' and 'aziotks', and sets appropriate permissions. ```bash ### Copy device certificate ### # If the device certificate and keys directories don't exist, create, set ownership, and set permissions sudo mkdir -p /var/aziot/certs sudo chown aziotcs:aziotcs /var/aziot/certs sudo chmod 755 /var/aziot/certs sudo mkdir -p /var/aziot/secrets sudo chown aziotks:aziotks /var/aziot/secrets sudo chmod 700 /var/aziot/secrets # Copy device full-chain certificate and private key into the correct directory sudo cp iot-device-downstream-full-chain.cert.pem /var/aziot/certs sudo cp iot-device-downstream.key.pem /var/aziot/secrets ### Root certificate ### # Copy root certificate into the /certs directory sudo cp azure-iot-test-only.root.ca.cert.pem /var/aziot/certs # Copy root certificate into the CA certificate directory and add .crt extension. # The root certificate must be in the CA certificate directory to install it in the certificate store. # Use the appropriate copy command for your device OS or if using EFLOW. # For Ubuntu and Debian, use /usr/local/share/ca-certificates/ sudo cp azure-iot-test-only.root.ca.cert.pem /usr/local/share/azure-iot-test-only.root.ca.cert.pem.crt # For EFLOW, use /etc/pki/ca-trust/source/anchors/ sudo cp azure-iot-test-only.root.ca.cert.pem /etc/pki/ca-trust/source/anchors/azure-iot-test-only.root.ca.pem.crt ``` -------------------------------- ### Initialize IoT Edge Solution with C Template Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux Initializes a new IoT Edge solution using the C template. This command scaffolds the project structure and configuration files. ```bash iotedgedev solution init --template c ``` -------------------------------- ### Start EFLOWProxy Service Source: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot-iot-edge-for-linux-on-windows If the EFLOWProxy service is stopped, use this PowerShell command to start it. Ensure you are running PowerShell as Administrator. ```PowerShell Start-Service -Name EFLOWProxy ``` -------------------------------- ### Create Certificate and Key Directories with Permissions Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-create-transparent-gateway Creates and sets ownership/permissions for certificate and key directories within the EFLOW VM. Use `/var/aziot` for storage. ```bash # If the certificate and keys directories don't exist, create, set ownership, and set permissions sudo mkdir -p /var/aziot/certs sudo chown aziotcs:aziotcs /var/aziot/certs sudo chmod 755 /var/aziot/certs sudo mkdir -p /var/aziot/secrets sudo chown aziotks:aziotks /var/aziot/secrets sudo chmod 700 /var/aziot/secrets ``` -------------------------------- ### Initialize IoT Edge Solution with C# Template Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux Initializes a new IoT Edge solution using the C# template. This command scaffolds the project structure and configuration files. ```bash iotedgedev solution init --template csharp ``` -------------------------------- ### Start WSSDAgent Service Source: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot-iot-edge-for-linux-on-windows Start the WSSDAgent service if it is found to be stopped. This service is essential for managing the EFLOW VM lifecycle. ```powershell Start-Service -Name WSSDAgent ``` -------------------------------- ### Get help for 'support-bundle' command Source: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot View the help information for the 'support-bundle' command to understand all available options and configurations. ```Bash iotedge support-bundle --help ``` -------------------------------- ### Configure manual provisioning with X.509 Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-single-device-linux-x509 Uncomment the lines for manual provisioning with an X.509 identity certificate in the configuration file. Ensure other provisioning sections are commented out. ```toml # For manual provisioning with X.509 certificate, uncomment the following lines: # provisioning: "manual" # x509: true # cert: "/var/lib/aziot/identity_service/device-identity/your-device.pem" # pk: "/var/lib/aziot/identity_service/device-identity/your-device.key" ``` -------------------------------- ### Install TPM2 Tools on Red Hat Enterprise Linux Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-tpm Installs the TPM2 Tools package on Red Hat Enterprise Linux systems. ```bash sudo yum install tpm2-tools ``` -------------------------------- ### Verify IoT Edge Certificate and Key Permissions Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-manage-device-certificates This command lists the directories and files recursively with details on ownership and permissions, allowing verification of the setup. ```bash sudo ls -Rla /var/aziot ``` -------------------------------- ### Set execute permission for install script Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge Grant execute permissions to the install script before running it. This is a necessary step to allow the script to be executed on the device. ```bash chmod +x install.sh ``` -------------------------------- ### Install Azure IoT SDK C Package with Vcpkg Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-visual-studio-develop-module Use Vcpkg to install the azure-iot-sdk-c package for the x64 Windows triplet and integrate it with your system. ```bash vcpkg.exe install azure-iot-sdk-c:x64-windows vcpkg.exe --triplet x64-windows integrate install ``` -------------------------------- ### Initialize IoT Edge Solution with Java Template Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux Initializes a new IoT Edge solution using the Java template. This command scaffolds the project structure and configuration files. ```bash iotedgedev solution init --template java ``` -------------------------------- ### Install Moby engine and CLI on RHEL Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-provision-devices-at-scale-linux-symmetric Installs the Moby container engine and its command-line interface on Red Hat Enterprise Linux (RHEL) or similar distributions. ```bash sudo yum install moby-engine moby-cli ``` -------------------------------- ### Install Node Packages for Module Debugging Source: https://learn.microsoft.com/en-us/azure/iot-edge/debug-module-vs-code Run this command in the integrated terminal within your module's folder to install necessary Node.js packages before debugging. ```bash npm install ``` -------------------------------- ### Initialize IoT Edge Solution with Node.js Template Source: https://learn.microsoft.com/en-us/azure/iot-edge/tutorial-develop-for-linux Initializes a new IoT Edge solution using the Node.js template. This command scaffolds the project structure and configuration files. ```bash iotedgedev solution init --template nodejs ``` -------------------------------- ### Allowing Multiple Custom Metrics Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-collect-and-transport-metrics This example shows how to allow the custom metrics 'mem' and 'cpu' for any labels and from any endpoint by simply listing their names. ```bash mem cpu ``` -------------------------------- ### Install DHCP Server Feature Source: https://learn.microsoft.com/en-us/azure/iot-edge/how-to-create-virtual-switch Install the DHCP Server feature and management tools if it is not already present on the host machine. This is a prerequisite for dynamic IP allocation. ```PowerShell Install-WindowsFeature -Name 'DHCP' -IncludeManagementTools ``` -------------------------------- ### Build Image for Local or Azure Container Registry Source: https://learn.microsoft.com/en-us/azure/iot-edge/debug-module-vs-code Example commands to build a Docker image for either a local registry or an Azure Container Registry. ```bash # Build the image for the local registry docker build --rm -f "./modules/filtermodule/Dockerfile.amd64.debug" -t localhost:5000/filtermodule:0.0.1-amd64 "./modules/filtermodule" # Or build the image for an Azure Container Registry docker build --rm -f "./modules/filtermodule/Dockerfile.amd64.debug" -t myacr.azurecr.io/filtermodule:0.0.1-amd64 "./modules/filtermodule" ``` -------------------------------- ### Start WSSDAGENT Service Source: https://learn.microsoft.com/en-us/azure/iot-edge/troubleshoot-iot-edge-for-linux-on-windows-common-errors If the WSSDAGENT service is found to be stopped, use this command to manually start it. This service is crucial for EFLOW VM creation and lifecycle management. ```powershell Start-Service -name WSSDAgent ```