az iot ops asset endpoint

注意

此參考是 Azure CLI 的 azure-iot-ops 擴充功能的一部分(2.53.0 版或更高版本)。 擴充功能會在您第一次執行 az iot ops asset endpoint 命令時自動安裝。 深入了解擴充功能。

命令群組 'iot ops' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

管理資產端點配置檔。

命令

名稱 Description 類型 狀態
az iot ops asset endpoint certificate

在資產端點中管理擁有的憑證。

副檔名 預覽​​
az iot ops asset endpoint certificate add

將擁有的憑證新增至資產端點。

副檔名 預覽​​
az iot ops asset endpoint certificate list

列出資產端點中擁有的憑證。

副檔名 預覽​​
az iot ops asset endpoint certificate remove

拿掉資產端點中擁有的憑證。

副檔名 預覽​​
az iot ops asset endpoint create

建立資產端點。

副檔名 預覽​​
az iot ops asset endpoint delete

刪除資產端點。

副檔名 預覽​​
az iot ops asset endpoint query

查詢資產端點的 Resource Graph。

副檔名 預覽​​
az iot ops asset endpoint show

顯示資產端點。

副檔名 預覽​​
az iot ops asset endpoint update

更新資產端點。

副檔名 預覽​​

az iot ops asset endpoint create

預覽

命令群組 'iot ops' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

建立資產端點。

必須提供自定義位置或叢集名稱。 此命令會檢查相關聯的自定義位置和叢集是否存在,並確保兩者都使用 microsoft.deviceregistry.assets 擴充功能正確設定。

Azure IoT OPC UA Broker (預覽版) 會針對自身與所連線之 OPC UA 伺服器之間的所有安全通道,使用相同的用戶端憑證。

az iot ops asset endpoint create --name
                                 --resource-group
                                 --ta
                                 [--ac]
                                 [--cert]
                                 [--cert-ref]
                                 [--cg]
                                 [--cl]
                                 [--clg]
                                 [--cls]
                                 [--cluster]
                                 [--cluster-subscription]
                                 [--location]
                                 [--password-ref]
                                 [--tags]
                                 [--ur]

範例

使用指定的自定義位置建立具有匿名使用者驗證的資產端點。

az iot ops asset endpoint create --name {asset_endpoint} -g {resource_group} --custom-location {custom_location} --target-address {target_address}

使用自定義位置的指定自定義位置和資源群組,建立具有匿名使用者驗證的資產端點。 如果訂用帳戶內有多個具有相同名稱的自定義位置,則必須包含資源群組。

az iot ops asset endpoint create --name {asset_endpoint} -g {resource_group} --custom-location {custom_location} --custom-location-resource-group {custom_location_resource_group} --target-address {target_address}

建立具有使用者名稱密碼使用者驗證的資產端點,並使用預先填入的值預先設定擁有的憑證。用戶名稱和密碼參考是透過 Azure Keyvault 容器記憶體介面驅動程式來設定。

az iot ops asset endpoint create --name myAssetEndpoint -g myRG --cluster myCluster --target-address "opc.tcp://opcplc-000000:50000" --username-ref "aio-opc-ua-broker-user-authentication/opc-plc-username" --password-ref "aio-opc-ua-broker-user-authentication/opc-plc-password" --cert secret=aio-opc-ua-broker-client-certificate thumbprint=000000000000000000 password=aio-opc-ua-broker-client-certificate-password

使用使用者名稱密碼使用者驗證和預先填入值的其他組態建立資產端點(powershell 語法範例)。

az iot ops asset endpoint create --name myAssetEndpoint -g myRG --cluster myCluster --target-address "opc.tcp://opcplc-000000:50000" --username-ref "aio-opc-ua-broker-user-authentication/opc-plc-username" --password-ref "aio-opc-ua-broker-user-authentication/opc-plc-password" --additional-config '{\"applicationName\": \"opcua-connector\", \"defaults\": { \"publishingIntervalMilliseconds\": 100,  \"samplingIntervalMilliseconds\": 500,  \"queueSize\": 15,}, \"session\": {\"timeout\": 60000}, \"subscription\": {\"maxItems\": 1000}, \"security\": { \"autoAcceptUntrustedServerCertificates\": true}}'

使用使用者名稱密碼使用者驗證建立資產端點,並使用預先填入的值建立其他組態(cmd 語法範例)。

az iot ops asset endpoint create --name myAssetEndpoint -g myRG --cluster myCluster --target-address "opc.tcp://opcplc-000000:50000" --username-ref "aio-opc-ua-broker-user-authentication/opc-plc-username" --password-ref "aio-opc-ua-broker-user-authentication/opc-plc-password" --additional-config "{\"applicationName\": \"opcua-connector\", \"defaults\": { \"publishingIntervalMilliseconds\": 100,  \"samplingIntervalMilliseconds\": 500,  \"queueSize\": 15,}, \"session\": {\"timeout\": 60000}, \"subscription\": {\"maxItems\": 1000}, \"security\": { \"autoAcceptUntrustedServerCertificates\": true}}"

使用使用者名稱密碼使用者驗證和預先填入值的其他組態建立資產端點(bash 語法範例)。

az iot ops asset endpoint create --name myAssetEndpoint -g myRG --cluster myCluster --target-address "opc.tcp://opcplc-000000:50000" --username-ref "aio-opc-ua-broker-user-authentication/opc-plc-username" --password-ref "aio-opc-ua-broker-user-authentication/opc-plc-password" --additional-config '{"applicationName": "opcua-connector", "defaults": { "publishingIntervalMilliseconds": 100,  "samplingIntervalMilliseconds": 500,  "queueSize": 15,}, "session": {"timeout": 60000}, "subscription": {"maxItems": 1000}, "security": { "autoAcceptUntrustedServerCertificates": true}}'

必要參數

--name -n

資產端點名稱。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--ta --target-address

目標位址。 必須是有效的本機位址。

選擇性參數

--ac --additional-config

連線類型的其他組態(例如:OPC UA、Modbus、ONVIF)。

--cert

與端點相關聯之憑證對應的空格分隔索引鍵=值組。 支援下列索引鍵值: secret (必要)、 thumbprint (必要)、 password.--cert 可以使用 1 或多次。 檢閱完整參數使用方式的說明範例。

--cert-ref --certificate-ref --cr

驗證中使用的憑證參考。 尚不支援這個用戶驗證方法。

--cg --cluster-resource-group

叢集的資源群組。

--cl --custom-location

用來將資產端點與叢集產生關聯的自定義位置。

--clg --custom-location-resource-group

自訂位置的資源群組。

--cls --custom-location-subscription

自訂位置的訂用帳戶標識碼。

--cluster -c

要與資產建立關聯的叢集。

--cluster-subscription --cs

叢集的訂用帳戶標識碼。

--location -l

位置。​​ 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--password-ref --pr

驗證中使用的密碼參考。

--tags

資產端點資源標籤。 索引鍵/值組中的屬性包,格式如下:a=b c=d。

--ur --username-reference

驗證中使用的用戶名稱參考。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂用帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az iot ops asset endpoint delete

預覽

命令群組 'iot ops' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

刪除資產端點。

az iot ops asset endpoint delete --name
                                 --resource-group

範例

刪除資產端點。

az iot ops asset endpoint delete --name {asset_endpoint} -g {resource_group}

必要參數

--name -n

資產端點名稱。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂用帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az iot ops asset endpoint query

預覽

命令群組 'iot ops' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

查詢資產端點的 Resource Graph。

az iot ops asset endpoint query [--ac]
                                [--am]
                                [--cl]
                                [--location]
                                [--resource-group]
                                [--ta]

範例

查詢匿名驗證的資產端點。

az iot ops asset endpoint query --authentication-mode Anonymous

查詢具有指定目標位址和自定義位置的資產端點。

az iot ops asset endpoint query --target-address {target_address} --custom-location {custom_location}

選擇性參數

--ac --additional-config

連線類型的其他組態(例如:OPC UA、Modbus、ONVIF)。

--am --authentication-mode

驗證模式。

--cl --custom-location

用來將資產端點與叢集產生關聯的自定義位置。

--location -l

位置。​​ 值的來源:az account list-locations。 您可以使用 az configure --defaults location=<location> 設定預設位置。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

--ta --target-address

目標位址。 必須是有效的本機位址。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂用帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az iot ops asset endpoint show

預覽

命令群組 'iot ops' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

顯示資產端點。

az iot ops asset endpoint show --name
                               --resource-group

範例

顯示資產端點的詳細數據。

az iot ops asset endpoint show --name {asset_endpoint} -g {resource_group}

必要參數

--name -n

資產端點名稱。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂用帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。

az iot ops asset endpoint update

預覽

命令群組 'iot ops' 處於預覽狀態,且正在開發中。 參考和支援層級: https://aka.ms/CLI_refstatus

更新資產端點。

若要更新擁有的憑證,請使用命令群組 az iot ops asset endpoint certificate

az iot ops asset endpoint update --name
                                 --resource-group
                                 [--ac]
                                 [--am]
                                 [--cert-ref]
                                 [--password-ref]
                                 [--ta]
                                 [--tags]
                                 [--ur]

範例

更新資產端點的驗證模式,以使用匿名用戶驗證。

az iot ops asset endpoint update --name {asset_endpoint} -g {resource_group} --authentication-mode Anonymous

使用預先填入的值更新資產端點的使用者名稱和密碼參考。 如果驗證模式尚未這麼做,這會將驗證模式轉換成 username-password。

az iot ops asset endpoint update --name myAssetEndpoint -g myRG --username-ref "aio-opc-ua-broker-user-authentication/opc-plc-username" --password-ref "aio-opc-ua-broker-user-authentication/opc-plc-password"

使用預先填入的值來更新資產端點的目標位址和其他設定(powershell 語法範例)。

az iot ops asset endpoint update --name myAssetEndpoint -g myRG --target-address "opc.tcp://opcplc-000000:50000" --additional-config '{\"applicationName\": \"opcua-connector\", \"defaults\": { \"publishingIntervalMilliseconds\": 100,  \"samplingIntervalMilliseconds\": 500,  \"queueSize\": 15,}, \"session\": {\"timeout\": 60000}, \"subscription\": {\"maxItems\": 1000}, \"security\": { \"autoAcceptUntrustedServerCertificates\": true}}'

使用預先填入的值來更新資產端點的目標位址和其他組態(cmd 語法範例)。

az iot ops asset endpoint update --name myAssetEndpoint -g myRG --target-address "opc.tcp://opcplc-000000:50000" --additional-config "{\"applicationName\": \"opcua-connector\", \"defaults\": { \"publishingIntervalMilliseconds\": 100,  \"samplingIntervalMilliseconds\": 500,  \"queueSize\": 15,}, \"session\": {\"timeout\": 60000}, \"subscription\": {\"maxItems\": 1000}, \"security\": { \"autoAcceptUntrustedServerCertificates\": true}}"

使用預先填入的值來更新資產端點的目標位址和其他組態(bash 語法範例)。

az iot ops asset endpoint update --name myAssetEndpoint -g myRG --target-address "opc.tcp://opcplc-000000:50000" --additional-config '{"applicationName": "opcua-connector", "defaults": { "publishingIntervalMilliseconds": 100,  "samplingIntervalMilliseconds": 500,  "queueSize": 15,}, "session": {"timeout": 60000}, "subscription": {"maxItems": 1000}, "security": { "autoAcceptUntrustedServerCertificates": true}}'

必要參數

--name -n

資產端點名稱。

--resource-group -g

資源群組的名稱。 您可以使用 az configure --defaults group=<name> 來設定預設群組。

選擇性參數

--ac --additional-config

連線類型的其他組態(例如:OPC UA、Modbus、ONVIF)。

--am --authentication-mode

驗證模式。

--cert-ref --certificate-ref --cr

驗證中使用的憑證參考。 尚不支援這個用戶驗證方法。

--password-ref --pr

驗證中使用的密碼參考。

--ta --target-address

目標位址。 必須是有效的本機位址。

--tags

資產端點資源標籤。 索引鍵/值組中的屬性包,格式如下:a=b c=d。

--ur --username-reference

驗證中使用的用戶名稱參考。

全域參數
--debug

增加記錄詳細資訊,以顯示所有偵錯記錄。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或識別碼。 您可以使用 az account set -s NAME_OR_ID 設定預設訂用帳戶。

--verbose

增加記錄詳細資訊。 使用 --debug 來取得完整偵錯記錄。