IoT 中心部署清单:可以指定模块身份标记吗?

IoT Hub Deployment Manifest: Possible to specify module identity tags?

当通过部署清单以编程方式将 Azure IoT Edge 解决方案部署到 IoT 中心时 (see here), is it possible to also immediately specify properties (tags) for module twins? like here

是的!您可以为此使用设备配置服务 (DPS)。

When you create an enrollment in DPS, you have the opportunity to declare an initial device twin state. In the device twin, you can set tags to group devices by any metric you need in your solution, like region, environment, location, or device type. These tags are used to create automatic deployments.

参考:Create and provision IoT Edge for Linux on Windows devices at scale using symmetric keys

清单文件中没有此类功能。 现在 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
        }
    }
}

}