az connectedmachine extension

Note

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

Manage machine extension with connectedmachine.

Commands

az connectedmachine extension create

The operation to Create the extension.

az connectedmachine extension delete

The operation to delete the extension.

az connectedmachine extension list

The operation to get all extensions of a non-Azure machine.

az connectedmachine extension show

The operation to get the extension.

az connectedmachine extension update

The operation to create or update the extension.

az connectedmachine extension wait

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

az connectedmachine extension create

The operation to Create the extension.

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

Examples

Create or Update a Machine Extension

az connectedmachine extension create --name "CustomScriptExtension" --location "eastus2euap" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{"commandToExecute":"hostname"}' --type-handler-version "1.10" --machine-name "myMachine" --resource-group "myResourceGroup"

Required Parameters

--machine-name

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

--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>.

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
--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>.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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.

--settings

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

--status

Instance view status.

--tags

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

--type

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

--type-handler-version

Specify the version of the script handler.

az connectedmachine extension delete

The operation to delete the extension.

az connectedmachine extension delete [--ids]
                                     [--machine-name]
                                     [--name]
                                     [--no-wait]
                                     [--resource-group]
                                     [--subscription]
                                     [--yes]

Examples

Delete a Machine Extension

az connectedmachine extension delete --name "MMA" --machine-name "myMachine" --resource-group "myResourceGroup"

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.

--machine-name

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

--name

The name of the machine extension.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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.

--yes -y

Do not prompt for confirmation.

default value: False

az connectedmachine extension list

The operation to get all extensions of a non-Azure machine.

az connectedmachine extension list --machine-name
                                   --resource-group
                                   [--expand]

Examples

Get all Machine Extensions

az connectedmachine extension list --machine-name "myMachine" --resource-group "myResourceGroup"

Required Parameters

--machine-name

The name of the machine containing the extension.

--resource-group -g

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

Optional Parameters

--expand

The expand expression to apply on the operation.

az connectedmachine extension show

The operation to get the extension.

az connectedmachine extension show [--ids]
                                   [--machine-name]
                                   [--name]
                                   [--resource-group]
                                   [--subscription]

Examples

Get Machine Extension

az connectedmachine extension show --name "CustomScriptExtension" --machine-name "myMachine" --resource-group "myResourceGroup"

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.

--machine-name

The name of the machine containing the extension.

--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.

az connectedmachine extension update

The operation to create or update the extension.

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

Examples

Create or Update a Machine Extension

az connectedmachine extension update --name "CustomScriptExtension" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings '{"commandToExecute":"hostname"}' --type-handler-version "1.10" --machine-name "myMachine" --resource-group "myResourceGroup"

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
--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.

--machine-name

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

--name

The name of the machine extension.

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--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

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

--type-handler-version

Specify the version of the script handler.

az connectedmachine extension wait

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

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

Examples

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

az connectedmachine extension wait --name "CustomScriptExtension" --machine-name "myMachine" --resource-group "myResourceGroup" --created

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

az connectedmachine extension wait --name "CustomScriptExtension" --machine-name "myMachine" --resource-group "myResourceGroup" --updated

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

az connectedmachine extension wait --name "CustomScriptExtension" --machine-name "myMachine" --resource-group "myResourceGroup" --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
--machine-name

The name of the machine containing the extension.

--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