当通过部署清单(参见此处)以编程方式将 Azure IoT Edge 解决方案部署到 IoT 中心时,是否还可以立即为模块孪生指定属性(标签)?喜欢这里。
问问题
55 次
2 回答
0
清单文件中没有这样的功能。现在 IoT Edge 遵循以下语法,并且 moduleContent 不允许除 properties.desired 之外的任何其他属性。
无论如何,您可以在从模块孪生部署后进行更新。
{
"modulesContent": {
"$edgeAgent": { // required
"properties.desired": {
// desired properties of the IoT Edge agent
// includes the image URIs of all deployed modules
// includes container registry credentials
}
},
"$edgeHub": { //required
"properties.desired": {
// desired properties of the IoT Edge hub
// includes the routing information between modules, and to IoT Hub
}
},
"module1": { // optional
"properties.desired": {
// desired properties of module1
}
},
"module2": { // optional
"properties.desired": {
// desired properties of module2
}
}
}
}
于 2021-10-27T21:45:26.320 回答
0
是的!您可以为此使用设备配置服务 (DPS)。
在 DPS 中创建注册时,您有机会声明初始设备孪生状态。在设备孪生中,您可以设置标签以按解决方案中所需的任何指标(例如区域、环境、位置或设备类型)对设备进行分组。这些标签用于创建自动部署。
于 2021-10-27T12:13:56.600 回答