1.创建IoTHub
2.准备Edge Device
①准备操作系统win server 2019
②在IoT Hub上创建IoT Edge Device
3.安装配置Azure IoT EdgeRuntime
在服务器上打开Windows PowerShell,依次输入以下命令
. {Invoke-WebRequest -useb aka.ms/iotedge-win} | Invoke-Expression; `
Uninstall-IoTEdge
Initialize-IoTEdge
把下图的主连接字符串粘过去
Get-Service iotedge
iotedge list
4.从Azure Container Registry 下载业务容器,由业务容器向Hub发遥测信息
首先访问:https://hub.docker.com/_/microsoft-azureiotedge-simulated-temperature-sensor
然后复制:mcr.microsoft.com/azureiotedge-simulated-temperature-sensor:1.0
打开下面粘贴:
回到边缘的powershell
输入命令:
iotedge list
然后:
再输入:
iotedge logs Sensor -f
打开vs code,安装azure IoT tools、azure cli tools、azure account模块。
然后登录,略。
然后点击下图
继续:
然后: