XenFi’s Azure IoT Environment
Table of Contents
Configuring Visual Studio Dependencies
-
- Choose the Azure development and Desktop development with C++ workloads options.
Install the Vcpkg library manager
mkdir C:/src cd C:/src/vcpkg git clone https://github.com/Microsoft/vcpkg cd vcpkg ./bootstrap-vcpkg.batInstall azure-iot-sdk
./vcpkg.exe install azure-iot-sdk-c:x64-windows ./vcpkg.exe --triplet x64-windows integrate installIn 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.cmakeInstall Docker
Configure Azure IoT Edge for Linux on Windows (EFLOW)
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 -AllIn 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 $msiPathInstall IoT Edge for Linux on Windows on your device.
Start-Process -Wait msiexec -ArgumentList "/i","$([io.Path]::Combine($env:TEMP, 'AzureIoTEdge.msi'))","/qn"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 -ForceCreate the IoT Edge for Linux on Windows deployment.
deploy-eflowProvision your linux vm as an IoT device for development and testing
Provision-EflowVm -provisioningType ManualConnectionString -devConnString "<CONNECTION_STRING_HERE>"You can connect to the EFLOW VM with the command:
Connect-EflowVmOnce in the VM, you can access iotedge just like you would on a XenFi device.
sudo iotedge list