az vmss lifecycle-hook

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Manage lifecycle hooks on a Virtual Machine Scale Set (preview).

Commands

Name Description Type Status
az vmss lifecycle-hook add

Add a lifecycle hook to a VMSS.

Core Preview
az vmss lifecycle-hook list

List all lifecycle hooks on a VMSS.

Core Preview
az vmss lifecycle-hook remove

Remove one lifecycle hook (--type) or all lifecycle hooks (--all) from a VMSS.

Core Preview
az vmss lifecycle-hook show

Show the details of a lifecycle hook on a VMSS.

Core Preview
az vmss lifecycle-hook update

Update an existing lifecycle hook on a VMSS.

Core Preview

az vmss lifecycle-hook add

Preview

Command group 'vmss lifecycle-hook' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add a lifecycle hook to a VMSS.

az vmss lifecycle-hook add --resource-group
                           --type {UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling}
                           --vmss-name
                           [--acquire-policy-token]
                           [--change-reference]
                           [--default-action {Approve, Reject}]
                           [--no-wait]
                           [--wait-duration]

Examples

Add an UpgradeAutoOSScheduling hook with an 8 hour wait.

az vmss lifecycle-hook add -g MyRg --vmss-name MyVmss --type UpgradeAutoOSScheduling --wait-duration PT8H

Required Parameters

--resource-group -g

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

--type

Specifies the type of the lifecycle hook.

Property Value
Accepted values: UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling
--vmss-name

The name of the VM scale set.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--default-action

Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil.

Property Value
Accepted values: Approve, Reject
--no-wait

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

Property Value
Default value: False
--wait-duration

Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer. It should be in ISO 8601 format.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az vmss lifecycle-hook list

Preview

Command group 'vmss lifecycle-hook' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List all lifecycle hooks on a VMSS.

az vmss lifecycle-hook list --resource-group
                            --vmss-name

Examples

List hooks.

az vmss lifecycle-hook list -g MyRg --vmss-name MyVmss

Required Parameters

--resource-group -g

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

--vmss-name

The name of the VM scale set.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az vmss lifecycle-hook remove

Preview

Command group 'vmss lifecycle-hook' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Remove one lifecycle hook (--type) or all lifecycle hooks (--all) from a VMSS.

az vmss lifecycle-hook remove --resource-group
                              --vmss-name
                              [--acquire-policy-token]
                              [--all]
                              [--change-reference]
                              [--no-wait]
                              [--type {UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling}]

Examples

Remove one hook type.

az vmss lifecycle-hook remove -g MyRg --vmss-name MyVmss --type UpgradeAutoOSScheduling

Remove all hooks.

az vmss lifecycle-hook remove -g MyRg --vmss-name MyVmss --all

Required Parameters

--resource-group -g

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

--vmss-name

The name of the VM scale set.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--all

Remove all lifecycle hooks. Mutually exclusive with --type.

Property Value
Default value: False
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--no-wait

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

Property Value
Default value: False
--type

Specifies the type of the lifecycle hook. Mutually exclusive with --all.

Property Value
Accepted values: UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az vmss lifecycle-hook show

Preview

Command group 'vmss lifecycle-hook' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show the details of a lifecycle hook on a VMSS.

az vmss lifecycle-hook show --resource-group
                            --type {UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling}
                            --vmss-name

Examples

Show a hook by type.

az vmss lifecycle-hook show -g MyRg --vmss-name MyVmss --type UpgradeAutoOSScheduling

Required Parameters

--resource-group -g

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

--type

Specifies the type of the lifecycle hook.

Property Value
Accepted values: UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling
--vmss-name

The name of the VM scale set.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az vmss lifecycle-hook update

Preview

Command group 'vmss lifecycle-hook' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update an existing lifecycle hook on a VMSS.

az vmss lifecycle-hook update --resource-group
                              --type {UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling}
                              --vmss-name
                              [--acquire-policy-token]
                              [--change-reference]
                              [--default-action {Approve, Reject}]
                              [--no-wait]
                              [--wait-duration]

Examples

Change the wait duration of a hook.

az vmss lifecycle-hook update -g MyRg --vmss-name MyVmss --type UpgradeAutoOSScheduling --wait-duration PT2H

Required Parameters

--resource-group -g

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

--type

Specifies the type of the lifecycle hook.

Property Value
Accepted values: UpgradeAutoOSRollingBatchStarting, UpgradeAutoOSScheduling
--vmss-name

The name of the VM scale set.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--default-action

Specifies the action that will be applied to a target resource in the virtual machine scale set lifecycle hook event if the platform does not receive a response from the customer for the target resource before waitUntil.

Property Value
Accepted values: Approve, Reject
--no-wait

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

Property Value
Default value: False
--wait-duration

Specifies the time duration a virtual machine scale set lifecycle hook event sent to the customer waits for a response from the customer. It should be in ISO 8601 format.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False