Share via


az azurestackhci virtualmachine extension

Note

This reference is part of the azurestackhci extension for the Azure CLI (version 2.15.0 or higher). The extension will automatically install the first time you run an az azurestackhci virtualmachine extension command. Learn more about extensions.

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage virtualmachine extension with azurestackhci.

Commands

Name Description Type Status
az azurestackhci virtualmachine extension create

Create a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension delete

Delete a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension list

List all the extensions for a virtualmachine.

Extension Experimental
az azurestackhci virtualmachine extension show

Get the details of a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension update

Update a virtualmachine extension.

Extension Experimental
az azurestackhci virtualmachine extension wait

Place the CLI in a waiting state until a condition of the virtualmachine extension is met.

Extension Experimental

az azurestackhci virtualmachine extension create

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create a virtualmachine extension.

az azurestackhci virtualmachine extension create --name
                                                 --resource-group
                                                 --virtualmachine-name
                                                 [--auto-upgrade-minor {false, true}]
                                                 [--enable-auto-upgrade {false, true}]
                                                 [--extension-type]
                                                 [--force-update-tag]
                                                 [--inst-handler-version]
                                                 [--instance-view-type]
                                                 [--location]
                                                 [--protected-settings]
                                                 [--publisher]
                                                 [--settings]
                                                 [--status]
                                                 [--tags]
                                                 [--type-handler-version]

Examples

PutExtension

az azurestackhci virtualmachine extension create --resource-group "test-rg" --location "West US2" --name "test-extension" --extension-type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{"commandToExecute":"hostname"}' --type-handler-version "1.10" --virtualmachine-name "test-virtualmachine"

Required Parameters

--name

The name of the extension.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--virtualmachine-name

The name of the virtualmachine where the extension should be created or updated.

Optional Parameters

--auto-upgrade-minor

Indicate whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.

Accepted values: false, true
--enable-auto-upgrade

Indicate whether the extension should be automatically upgraded by the platform if there is a newer version available.

Accepted values: false, true
--extension-type

Specify the type of the virtualmachine extension; an example is CustomScriptExtension.

--force-update-tag

How the extension handler should be forced to update even if the extension configuration has not changed.

--inst-handler-version

Specify the version of the script handler.

--instance-view-type

Specify the type of the extension; an example is "CustomScriptExtension".

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

--protected-settings

The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected value: json-string/json-file/@json-file.

--publisher

The name of the virtualmachine extension handler publisher.

--settings

Json formatted public settings for the virtualmachine extension.

--status

Instance view status.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--type-handler-version

Specify the version of the script handler.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az azurestackhci virtualmachine extension delete

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Delete a virtualmachine extension.

az azurestackhci virtualmachine extension delete [--ids]
                                                 [--name]
                                                 [--resource-group]
                                                 [--subscription]
                                                 [--virtualmachine-name]
                                                 [--yes]

Examples

DeleteExtension

az azurestackhci virtualmachine extension delete --name "test-extension" --virtualmachine-name "test-virtualmachine" --resource-group "test-rg"

Optional Parameters

--ids

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.

--name

The name of the machine extension.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--virtualmachine-name

The name of the virtual machine where the extension should be deleted from.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az azurestackhci virtualmachine extension list

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all the extensions for a virtualmachine.

az azurestackhci virtualmachine extension list --resource-group
                                               --virtualmachine-name

Examples

ListExtensions

az azurestackhci virtualmachine extension list --virtualmachine-name "test-virtualmachine" --resource-group "test-rg"

Required Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--virtualmachine-name

The name of the virtual machine containing the extension.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az azurestackhci virtualmachine extension show

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get the details of a virtualmachine extension.

az azurestackhci virtualmachine extension show [--ids]
                                               [--name]
                                               [--resource-group]
                                               [--subscription]
                                               [--virtualmachine-name]

Examples

GetExtension

az azurestackhci virtualmachine extension show --name "test-extension" --virtualmachine-name "test-virtualmachine" --resource-group "test-rg"

Optional Parameters

--ids

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.

--name

The name of the machine extension.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--virtualmachine-name

The name of the virtual machine containing the extension.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az azurestackhci virtualmachine extension update

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a virtualmachine extension.

az azurestackhci virtualmachine extension update --name
                                                 [--auto-upgrade-minor {false, true}]
                                                 [--enable-auto-upgrade {false, true}]
                                                 [--extension-type]
                                                 [--force-update-tag]
                                                 [--ids]
                                                 [--protected-settings]
                                                 [--publisher]
                                                 [--resource-group]
                                                 [--settings]
                                                 [--subscription]
                                                 [--tags]
                                                 [--type-handler-version]
                                                 [--virtualmachine-name]

Examples

UpdateExtension

az azurestackhci virtualmachine extension update --resource-group "test-rg" --name "test-extension" --extension-type "CustomScriptExtension" --virtualmachine-name "test-virtualmachine" --publisher "Microsoft.Compute" --settings '{"commandToExecute":"hostname"}' --type-handler-version "1.10"

Required Parameters

--name

The name of the extension.

Optional Parameters

--auto-upgrade-minor

Indicate whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true.

Accepted values: false, true
--enable-auto-upgrade

Indicate whether the extension should be automatically upgraded by the platform if there is a newer version available.

Accepted values: false, true
--extension-type

Specify the type of the extension; an example is "CustomScriptExtension".

--force-update-tag

How the extension handler should be forced to update even if the extension configuration has not changed.

--ids

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.

--protected-settings

The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. Expected value: json-string/json-file/@json-file.

--publisher

The name of the extension handler publisher.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--settings

Json formatted public settings for the extension. Expected value: json-string/json-file/@json-file.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--type-handler-version

Specify the version of the script handler.

--virtualmachine-name

The name of the virtual machine containing the extension.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az azurestackhci virtualmachine extension wait

Experimental

Command group 'azurestackhci' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Place the CLI in a waiting state until a condition of the virtualmachine extension is met.

az azurestackhci virtualmachine extension wait [--created]
                                               [--custom]
                                               [--deleted]
                                               [--exists]
                                               [--ids]
                                               [--interval]
                                               [--name]
                                               [--resource-group]
                                               [--subscription]
                                               [--timeout]
                                               [--updated]
                                               [--virtualmachine-name]

Examples

Pause executing next line of CLI script until the virtualmachine extension is successfully created.

az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" --resource-group "test-rg" --created

Pause executing next line of CLI script until the virtualmachine extension is successfully updated.

az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" --resource-group "test-rg" --updated

Pause executing next line of CLI script until the virtualmachine extension is successfully deleted.

az azurestackhci virtualmachine extension wait --name "test-extension" --virtualmachine-name "test-virtualmachine" --resource-group "test-rg" --deleted

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--ids

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.

--interval

Polling interval in seconds.

Default value: 30
--name

The name of the machine extension.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
--virtualmachine-name

The name of the virtual machine containing the extension.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.