az connectedmachine machine-extension

Connectedmachine machine-extension.

Commands

az connectedmachine machine-extension create

The operation to create or update the extension.

az connectedmachine machine-extension delete

The operation to delete the extension.

az connectedmachine machine-extension list

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

az connectedmachine machine-extension show

The operation to get the extension.

az connectedmachine machine-extension update

The operation to update the extension.

az connectedmachine machine-extension wait

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

az connectedmachine machine-extension create

The operation to create or update the extension.

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

Examples

Create or Update a Machine Extension

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

Required Parameters

--extension-name --name -n

The name of the machine extension.

--location -l

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

--machine-name

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

--resource-group -g

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

Optional Parameters

--auto-upgrade-minor

Indicates 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
--force-update-tag

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

--no-wait

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

--protected-settings

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

--publisher

The name of the extension handler publisher.

--settings

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

--tags

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

--type

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

--type-handler-version

Specifies the version of the script handler.

az connectedmachine machine-extension delete

The operation to delete the extension.

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

Examples

Delete a Machine Extension

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

Required Parameters

--extension-name --name -n

The name of the machine extension.

--machine-name

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

--resource-group -g

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

Optional Parameters

--no-wait

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

--yes -y

Do not prompt for confirmation.

az connectedmachine machine-extension list

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

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

Examples

Get all Machine Extensions

az connectedmachine machine-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 machine-extension show

The operation to get the extension.

az connectedmachine machine-extension show --extension-name
                                           --machine-name
                                           --resource-group

Examples

Get Machine Extension

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

Required Parameters

--extension-name --name -n

The name of the machine extension.

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

az connectedmachine machine-extension update

The operation to update the extension.

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

Examples

Update a Machine Extension

az connectedmachine machine-extension update --machine-name "myMachine" --name "CustomScriptExtension" --type "CustomScriptExtension" --publisher "Microsoft.Compute" --settings "{\"commandToExecute\":\"powershell.exe -c \\\"Get-Process | Where-Object { $_.CPU -lt 100 }\\\"\"}" --type-handler-version "1.10" --resource-group "myResourceGroup"

Required Parameters

--extension-name --name -n

The name of the machine extension.

--machine-name

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

--resource-group -g

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

Optional Parameters

--auto-upgrade-minor

Indicates 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
--force-update-tag

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

--no-wait

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

--protected-settings

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

--publisher

The name of the extension handler publisher.

--settings

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

--tags

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

--type

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

--type-handler-version

Specifies the version of the script handler.

az connectedmachine machine-extension wait

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

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

Examples

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

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

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

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

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

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

Required Parameters

--extension-name --name -n

The name of the machine extension.

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

--created

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

--custom

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

--deleted

Wait until deleted.

--exists

Wait until the resource exists.

--interval

Polling interval in seconds.

default value: 30
--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.