XenFi’s Azure IoT Environment

Table of Contents

Configuring Visual Studio Dependencies

  • Visual Studio 2022

    • Choose the Azure development and Desktop development with C++ workloads options.
  • Azure IoT Edge Tools

  • Install the Vcpkg library manager

    mkdir C:/src
    cd C:/src/vcpkg
    git clone https://github.com/Microsoft/vcpkg
    cd vcpkg
    ./bootstrap-vcpkg.bat
  • Install azure-iot-sdk

    ./vcpkg.exe install azure-iot-sdk-c:x64-windows
    ./vcpkg.exe --triplet x64-windows integrate install

    In order to use vcpkg with CMake outside of an IDE, you can use the toolchain file:

    cmake -B [build directory] -S . -DCMAKE_TOOLCHAIN_FILE=C:/src/vcpkg/scripts/buildsystems/vcpkg.cmake
  • Install Azure CLI

  • Install Docker

Configure Azure IoT Edge for Linux on Windows (EFLOW)

  1. In an elevated PowerShell session, run the following command to enable Hyper-V. For more information, check Hyper-V on Windows 10.

    Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
  2. In an elevated PowerShell session, run each of the following commands to download IoT Edge for Linux on Windows.

    $msiPath = $([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi'))
    $ProgressPreference = 'SilentlyContinue'
    Invoke-WebRequest "https://aka.ms/AzEFLOWMSI_1_4_LTS_X64" -OutFile $msiPath
  3. Install IoT Edge for Linux on Windows on your device.

    Start-Process -Wait msiexec -ArgumentList "/i","$([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi'))","/qn"
  4. 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:

    Set-ExecutionPolicy -ExecutionPolicy AllSigned -Force
  5. Create the IoT Edge for Linux on Windows deployment.

    deploy-eflow
  6. Provision your linux vm as an IoT device for development and testing

    Provision-EflowVm -provisioningType ManualConnectionString -devConnString "<CONNECTION_STRING_HERE>"
  7. You can connect to the EFLOW VM with the command:

    Connect-EflowVm
  8. Once in the VM, you can access iotedge just like you would on a XenFi device.

    sudo iotedge list