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.
az account list-locations
中的值。 可以使用 az configure --defaults location=<location>
配置默认位置。
vm 扩展的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
应在其中创建或更新扩展的 VM 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示扩展是否应在部署时使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。
属性 | 值 |
---|---|
接受的值: | false, true |
指示如果有较新版本可用,平台是否应自动升级扩展。
属性 | 值 |
---|---|
接受的值: | false, true |
即使扩展配置未更改,扩展处理程序也应强制更新。
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。 预期值:json-string/json-file/@json-file。
扩展处理程序发布者的名称。
扩展的 Json 格式公共设置。 预期值:json-string/json-file/@json-file。
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
指定扩展的类型;例如“CustomScriptExtension”。
指定脚本处理程序的版本。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --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.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
vm 扩展的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
应删除扩展的 VM 的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不要提示确认。
属性 | 值 |
---|---|
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --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"
必需参数
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
包含扩展的 VM 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要应用于作的展开表达式。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --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.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
vm 扩展的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
包含扩展的 VM 的名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --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"
必需参数
vm 扩展的名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
应在其中创建或更新扩展的 VM 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示扩展是否应在部署时使用较新的次要版本。 但是,部署后,除非重新部署,否则扩展不会升级次要版本,即使此属性设置为 true 也是如此。
属性 | 值 |
---|---|
接受的值: | false, true |
指示如果有较新版本可用,平台是否应自动升级扩展。
属性 | 值 |
---|---|
接受的值: | false, true |
即使扩展配置未更改,扩展处理程序也应强制更新。
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
该扩展可以包含 protectedSettings 或 protectedSettingsFromKeyVault,或者根本不包含受保护的设置。 预期值:json-string/json-file/@json-file。
扩展处理程序发布者的名称。
扩展的 Json 格式公共设置。 预期值:json-string/json-file/@json-file。
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
指定扩展的类型;例如“CustomScriptExtension”。
指定脚本处理程序的版本。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |