你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az connectedvmware vm extension

Note

This reference is part of the connectedvmware extension for the Azure CLI (version 2.0.67 or higher). 该扩展将在首次运行 az connectedvmware vm extension 命令时自动安装。 Learn more about extensions.

使用 connectedvmware 管理 VM 扩展。

命令

名称 说明 类型 Status
az connectedvmware vm extension create

用于创建扩展的作。

Extension GA
az connectedvmware vm extension delete

删除扩展的作。

Extension GA
az connectedvmware vm extension list

获取非 Azure VM 的所有扩展的操作。

Extension GA
az connectedvmware vm extension show

用于获取扩展的作。

Extension GA
az connectedvmware vm extension update

用于更新扩展的作。

Extension 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

Location. az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--name

vm 扩展的名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

--vm-name

应在其中创建或更新扩展的 VM 的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--auto-upgrade-minor

指示扩展是否应在部署时使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。

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

指示如果有较新版本可用,平台是否应自动升级扩展。

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

即使扩展配置未更改,扩展处理程序也应强制更新。

--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--protected-settings

该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。 预期值: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

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

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"

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name

vm 扩展的名称。

属性
Parameter group: Resource Id Arguments
--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

属性
Parameter group: Resource Id Arguments
--vm-name

应删除扩展的 VM 的名称。

属性
Parameter group: Resource Id Arguments
--yes -y

不要提示确认。

属性
默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

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 的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--expand

要应用于作的展开表达式。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

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"

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。

属性
Parameter group: Resource Id Arguments
--name

vm 扩展的名称。

属性
Parameter group: Resource Id Arguments
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name>配置默认组。

属性
Parameter group: Resource Id Arguments
--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

属性
Parameter group: Resource Id Arguments
--vm-name

包含扩展的 VM 的名称。

属性
Parameter group: Resource Id Arguments
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False

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 的名称。

可选参数

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--auto-upgrade-minor

指示扩展是否应在部署时使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。

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

指示如果有较新版本可用,平台是否应自动升级扩展。

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

即使扩展配置未更改,扩展处理程序也应强制更新。

--no-wait

不等待长时间运行的操作完成。

属性
默认值: False
--protected-settings

该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。 预期值: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

提高日志记录详细程度以显示所有调试日志。

属性
默认值: False
--help -h

显示此帮助消息并退出。

--only-show-errors

仅显示错误,禁止显示警告。

属性
默认值: False
--output -o

Output format.

属性
默认值: json
接受的值: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

增加日志记录详细程度。 使用 --debug 获取完整的调试日志。

属性
默认值: False