az connectedvmware vm extension

注意

此參考是 Azure CLI 的 connectedvmware 擴充功能的一部分 (2.0.67 版或更高版本)。 當您第一次執行 az connectedvmware vm extension 命令時,擴充功能會自動安裝。 深入了解擴充功能。

使用 connectedvmware 管理 VM 擴充功能。

命令

名稱 Description 類型 狀態
az connectedvmware vm extension create

要建立延伸模組的作業。

擴充 GA
az connectedvmware vm extension delete

要刪除延伸模組的作業。

擴充 GA
az connectedvmware vm extension list

取得非 Azure VM 所有擴充功能的作業。

擴充 GA
az connectedvmware vm extension show

取得延伸模組的作業。

擴充 GA
az connectedvmware vm extension update

更新延伸模組的作業。

擴充 GA

az connectedvmware vm extension create

要建立延伸模組的作業。

az connectedvmware vm extension create --location
                                       --name
                                       --resource-group
                                       --vm-name
                                       [--auto-upgrade-minor {false, true}]
                                       [--enable-auto-upgrade {false, true}]
                                       [--force-update-tag]
                                       [--no-wait]
                                       [--protected-settings]
                                       [--publisher]
                                       [--settings]
                                       [--tags]
                                       [--type]
                                       [--type-handler-version]

範例

建立 VM 擴充功能

az connectedvmware vm extension create --name "CustomScriptExtension" --location "eastus2euap" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -gt 10000 }\\\"\"}" --type-handler-version "1.10" --vm-name "vm name" --resource-group "myResourceGroup"

必要參數

--location -l

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

--name

vm 擴充功能的名稱。

--resource-group -g

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

--vm-name

應建立或更新擴充功能之 VM 的名稱。

選擇性參數

--auto-upgrade-minor

指出如果部署期間有新的次要版本,延伸模組是否應該使用較新的次要版本。 不過,部署之後,除非重新部署,否則擴充功能不會升級次要版本,即使此屬性設定為 true 也一定會升級。

接受的值: false, true
--enable-auto-upgrade

指出如果有較新版本可用,平臺是否應該自動升級延伸模組。

接受的值: false, true
--force-update-tag

即使延伸模組組態尚未變更,延伸模組處理常式也應該強制更新。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--protected-settings

延伸模組可以包含 protected設定 或 protected設定FromKeyVault 或完全沒有受保護的設定。 預期值:json-string/json-file/@json-file。

--publisher

擴充處理常式發行者的名稱。

--settings

擴充功能的 Json 格式化公用設定。 預期值:json-string/json-file/@json-file。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「」 清除現有的標記。

--type

指定延伸模組的類型;例如「CustomScriptExtension」。

--type-handler-version

指定腳本處理常式的版本。

全域參數
--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 connectedvmware vm extension delete

要刪除延伸模組的作業。

az connectedvmware vm extension delete [--ids]
                                       [--name]
                                       [--no-wait]
                                       [--resource-group]
                                       [--subscription]
                                       [--vm-name]
                                       [--yes]

範例

刪除 VM 擴充功能

az connectedvmware vm extension delete --name "vm extension name" --vm-name "vm name" --resource-group "myResourceGroup"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name

vm 擴充功能的名稱。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--resource-group -g

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

--subscription

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

--vm-name

應刪除擴充功能之 VM 的名稱。

--yes -y

不提示確認。

預設值: False
全域參數
--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 connectedvmware vm extension list

取得非 Azure VM 所有擴充功能的作業。

az connectedvmware vm extension list --resource-group
                                     --vm-name
                                     [--expand]

範例

取得所有 VM 擴充功能

az connectedvmware vm extension list --vm-name "vm name" --resource-group "myResourceGroup"

必要參數

--resource-group -g

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

--vm-name

包含擴充功能的 VM 名稱。

選擇性參數

--expand

要套用至作業的展開運算式。

全域參數
--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 connectedvmware vm extension show

取得延伸模組的作業。

az connectedvmware vm extension show [--ids]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]
                                     [--vm-name]

範例

取得 VM 擴充功能

az connectedvmware vm extension show --name "CustomScriptExtension" --vm-name "vm name" --resource-group "myResourceGroup"

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name

vm 擴充功能的名稱。

--resource-group -g

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

--subscription

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

--vm-name

包含擴充功能的 VM 名稱。

全域參數
--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 connectedvmware vm extension update

更新延伸模組的作業。

az connectedvmware vm extension update --name
                                       --resource-group
                                       --vm-name
                                       [--auto-upgrade-minor {false, true}]
                                       [--enable-auto-upgrade {false, true}]
                                       [--force-update-tag]
                                       [--no-wait]
                                       [--protected-settings]
                                       [--publisher]
                                       [--settings]
                                       [--tags]
                                       [--type]
                                       [--type-handler-version]

範例

更新 VM 擴充功能

az connectedvmware vm extension update --name "CustomScriptExtension" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\"\"}" --type-handler-version "1.10" --vm-name "vm name" --resource-group "myResourceGroup"

必要參數

--name

vm 擴充功能的名稱。

--resource-group -g

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

--vm-name

應建立或更新擴充功能之 VM 的名稱。

選擇性參數

--auto-upgrade-minor

指出如果部署期間有新的次要版本,延伸模組是否應該使用較新的次要版本。 不過,部署之後,除非重新部署,否則擴充功能不會升級次要版本,即使此屬性設定為 true 也一定會升級。

接受的值: false, true
--enable-auto-upgrade

指出如果有較新版本可用,平臺是否應該自動升級延伸模組。

接受的值: false, true
--force-update-tag

即使延伸模組組態尚未變更,延伸模組處理常式也應該強制更新。

--no-wait

請勿等候長時間執行的作業完成。

預設值: False
--protected-settings

延伸模組可以包含 protected設定 或 protected設定FromKeyVault 或完全沒有受保護的設定。 預期值:json-string/json-file/@json-file。

--publisher

擴充處理常式發行者的名稱。

--settings

擴充功能的 Json 格式化公用設定。 預期值:json-string/json-file/@json-file。

--tags

以空格分隔的標記:key[=value] [key[=value] ...]。使用 「」 清除現有的標記。

--type

指定延伸模組的類型;例如「CustomScriptExtension」。

--type-handler-version

指定腳本處理常式的版本。

全域參數
--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 來取得完整偵錯記錄。