尝试获取 IoT 中心的等效命令

问题描述 投票:0回答:1

我正在尝试获取等效的 IoT 中心命令

az iot central app show --name ${{ parameters.iotcName }} | ConvertFrom-Json

获取并打印。

我尝试将物联网中心更改为物联网集线器以使此命令起作用。

azure iot azure-iot-hub
1个回答
0
投票

Azure CLI 中的

az iot hub show
命令用于检索有关 IoT hub

的详细信息
az iot hub show --name <IoT Hub Name>
az iot hub show --name HubName -g resourese grup name 

enter image description here

要解析 Azure CLI 命令的 JSON 输出,请使用 jq。

使用

jq
,您可以提取特定字段

enter image description here

enter image description here

az iot hub show --name HubName -g resourese grup name | jq '.name, .location, .properties.hostName, .sku.name'

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.