背景
我正在使用Azure-cli (版本>2.3.1)到创建IoT边缘部署
echo az iot edge deployment create --content $(iotDeploymentPath) --deployment-id $(deploymentId) --hub-name ${hub} --priority $(priority) --target-condition "tags.location.place='$(env)'"对于获取度量
targetedCount="$(az iot edge deployment show-metric --deployment-id $(deploymentId) --metric-id targetedCount --hub-name ${hub})"
appliedCount="$(az iot edge deployment show-metric --deployment-id $(deploymentId) --metric-id appliedCount --hub-name ${hub})"
reportedSuccessfulCount="$(az iot edge deployment show-metric --deployment-id $(deploymentId) --metric-id reportedSuccessfulCount --hub-name ${hub})"几天前,在尝试接收部署的指标时,我们收到了以下错误消息:
在设备配置$(TargetedCount)中没有定义度量‘deploymentId’。 在设备配置$(AppliedCount)中没有定义度量‘deploymentId’。 在设备配置$(ReportedSuccessfulCount)中没有定义度量‘deploymentId’。
随附下列感化讯息:
这个扩展名‘azure-cli-物联网-ext’是不推荐的,并计划删除。请删除,并添加‘天青-物联网’。
所以我已经安装了'azure-iot‘而不是’azure-cli‘,但是现在似乎az iot edge deployment show-metric停止工作了,并且一直发送上面提到的错误消息。
在设备配置$(TargetedCount)中没有定义度量‘deploymentId’。 在设备配置$(AppliedCount)中没有定义度量‘deploymentId’。 在设备配置$(ReportedSuccessfulCount)中没有定义度量‘deploymentId’。
问题:
如果不使用CLI不推荐的扩展版本,我如何才能得到那些metrics返回?
发布于 2020-08-13 06:41:03
引用Azure支持小组的回答:
我刚收到我们产品组的最新消息。他们告诉我,在azure-cli 0.8.7之前,物联网边缘部署显示度量只会违反系统度量标准。之后,引入了一个参数,使用户能够在系统和用户度量之间切换,但是为了匹配物联网集线器配置显示度量,用户度量成为默认的(这将转到azure-物联网)。 此外,PG成员指出,引起问题的所有指标似乎都是系统度量。在这种情况下,请尝试使用值“system”添加-度量类型或-mt参数. 例如:
az iot edge deployment show-metric -n myiothub -d mydeployment -m targetedCount --mt system
https://stackoverflow.com/questions/63375547
复制相似问题