az vm extension
Manage extensions on VMs.
Extensions are small applications that provide post-deployment configuration and automation tasks on Azure virtual machines. For example, if a virtual machine requires software installation, anti-virus protection, or Docker configuration, a VM extension can be used to complete these tasks. Extensions can be bundled with a new virtual machine deployment or run against any existing system.
Commands
Name | Description | Type | Status |
---|---|---|---|
az vm extension delete |
Delete operation to delete the extension. |
Core | GA |
az vm extension image |
Find the available VM extensions for a subscription and region. |
Core | GA |
az vm extension image list |
List the information on available extensions. |
Core | GA |
az vm extension image list-names |
List the names of available extensions. |
Core | GA |
az vm extension image list-versions |
List the versions for available extensions. |
Core | GA |
az vm extension image show |
Display information for an extension. |
Core | GA |
az vm extension list |
List the extensions attached to a VM. |
Core | GA |
az vm extension set |
Set extensions for a VM. |
Core | GA |
az vm extension show |
Display information about extensions attached to a VM. |
Core | GA |
az vm extension wait |
Place the CLI in a waiting state until a condition is met. |
Core | GA |
az vm extension delete
Delete operation to delete the extension.
az vm extension delete [--ids]
[--name --vm-extension-name]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--resource-group]
[--subscription]
[--vm-name]
Examples
Use a VM name and extension to delete an extension from a VM.
az vm extension delete -g MyResourceGroup --vm-name MyVm -n MyExtensionName
Delete extensions with IDs containing the string "MyExtension" from a VM.
az vm extension delete --ids $(az resource list --query "[?contains(name, 'MyExtension')].id" -o tsv)
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The name of the virtual machine extension.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Accepted values: | 0, 1, f, false, n, no, t, true, y, yes |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az vm extension list
List the extensions attached to a VM.
az vm extension list [--ids]
[--resource-group]
[--subscription]
[--vm-name]
Examples
List attached extensions to a named VM.
az vm extension list -g MyResourceGroup --vm-name MyVm
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az vm extension set
Set extensions for a VM.
Get extension details from az vm extension image list
.
az vm extension set --name
--publisher
[--enable-auto-upgrade {false, true}]
[--extension-instance-name]
[--force-update]
[--ids]
[--no-auto-upgrade {false, true}]
[--no-auto-upgrade-minor-version {false, true}]
[--no-wait]
[--protected-settings]
[--resource-group]
[--settings]
[--subscription]
[--version]
[--vm-name]
Examples
Add a user account to a Linux VM.
az vm extension set -n VMAccessForLinux --publisher Microsoft.OSTCExtensions --version 1.4 \
--vm-name MyVm --resource-group MyResourceGroup \
--protected-settings '{"username":"user1", "ssh_key":"ssh_rsa ..."}'
Add a customScript extension to VM(s) specified by --ids.
az vm extension set -n customScript --publisher Microsoft.Azure.Extensions --ids {vm_id}
Add an extension and enable automatic upgrade by the platform if there is a newer version of the extension available.
az vm extension set -n extName --publisher publisher --vm-name MyVM -g MyResourceGroup \
--enable-auto-upgrade true
Required Parameters
Name of the extension.
Property | Value |
---|---|
Value from: | az vm extension image list |
The name of the extension publisher.
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Indicate the extension should be automatically upgraded by the platform if there is a newer version of the extension available.
Property | Value |
---|---|
Accepted values: | false, true |
Name of extension instance, which can be customized. Default: name of the extension.
Force to update even if the extension configuration has not changed.
Property | Value |
---|---|
Default value: | False |
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Option '--no-auto-upgrade' has been deprecated and will be removed in a future release. Use '--no-auto-upgrade-minor-version' instead.
If set, the extension service will not automatically pick or upgrade to the latest minor version, even if the extension is redeployed.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
If set, the extension service will not automatically pick or upgrade to the latest minor version, even if the extension is redeployed.
Property | Value |
---|---|
Default value: | False |
Accepted values: | false, true |
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Default value: | False |
Protected settings in JSON format for sensitive information like credentials. A JSON file path is also accepted.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Extension settings in JSON format. A JSON file path is also accepted.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The version of the extension. To pin extension version to this value, please specify --no-auto-upgrade-minor-version.
The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az vm extension show
Display information about extensions attached to a VM.
az vm extension show [--ids]
[--instance-view]
[--name]
[--resource-group]
[--subscription]
[--vm-name]
Examples
Use VM name and extension name to show the extensions attached to a VM.
az vm extension show -g MyResourceGroup --vm-name MyVm -n extension_name
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The instance view of a virtual machine extension.
Property | Value |
---|---|
Default value: | False |
Name of the extension.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |
az vm extension wait
Place the CLI in a waiting state until a condition is met.
az vm extension wait [--created]
[--custom]
[--deleted]
[--exists]
[--expand]
[--ids]
[--interval]
[--name --vm-extension-name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
[--vm-name]
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
Wait until created with 'provisioningState' at 'Succeeded'.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Wait until deleted.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
Wait until the resource exists.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
The expand expression to apply on the operation.
One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Polling interval in seconds.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | 30 |
The name of the virtual machine extension.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Maximum wait in seconds.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | 3600 |
Wait until updated with provisioningState at 'Succeeded'.
Property | Value |
---|---|
Parameter group: | Wait Condition Arguments |
Default value: | False |
The name of the Virtual Machine. You can configure the default using az configure --defaults vm=<name>
.
Property | Value |
---|---|
Parameter group: | Resource Id Arguments |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |