Azure IoT Edge模块孪生配置:能否基于设备孪生标签创建目标条件?
基于Device Twin标签筛选Azure IoT Edge模块的目标条件配置
可行,你可以通过引用父设备(Device Twin)的属性来实现这个需求,在目标条件的查询语句里用$parent关键字来访问Device Twin的标签。
具体写法示例:
- 单标签筛选:
from devices.modules where $parent.tags.environment = 'prod' - 多标签组合筛选:
from devices.modules where $parent.tags.environment = 'prod' AND $parent.tags.location = 'westus' - 结合Module自身属性和Device Twin标签筛选:
from devices.modules where moduleId = 'edgeModule01' AND $parent.tags.team = 'IoTTeam'
说明:
$parent关键字会指向当前模块所属的父设备的Device Twin,通过它就能直接引用Device Twin里的标签、属性等内容,让你可以基于设备层面的标签来筛选对应的模块。
内容的提问来源于stack exchange,提问作者MystCabe
相关产品推荐
相关产品推荐

