az vmss lifecycle-hook-event

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

Manage Lifecycle Hook Event.

Commands

Name Description Type Status
az vmss lifecycle-hook-event approve

Approve a virtual machine scale set lifecycle hook event.

Core Preview
az vmss lifecycle-hook-event list

List a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource.

Core Preview
az vmss lifecycle-hook-event reject

Reject a virtual machine scale set lifecycle hook event.

Core Preview
az vmss lifecycle-hook-event show

Get a virtual machine scale set lifecycle hook event.

Core Preview
az vmss lifecycle-hook-event update

Update a virtual machine scale set lifecycle hook event.

Core Preview

az vmss lifecycle-hook-event approve

Preview

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

Approve a virtual machine scale set lifecycle hook event.

az vmss lifecycle-hook-event approve [--acquire-policy-token]
                                     [--change-reference]
                                     [--ids]
                                     [--instance-ids]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]
                                     [--vmss-name]

Examples

Approve all target resources of a lifecycle hook event.

az vmss lifecycle-hook-event approve --vmss-name MyVmss -g MyRg --name {eventGuid}

Approve a subset of target resources.

az vmss lifecycle-hook-event approve --vmss-name MyVmss -g MyRg --name {eventGuid} --instance-ids 0 1 2

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

Property Value
Parameter group: Resource Id Arguments
--instance-ids

Space-separated list of identifiers for target resources in the lifecycle hook event. For a scale-set-level event such as UpgradeAutoOSScheduling, specify the VM scale set name. For an instance-level event such as UpgradeAutoOSRollingBatchStarting, specify decimal instance IDs for a Uniform scale set (e.g. 0 1 2) or VM names for a Flexible scale set. Each identifier must correspond to a target resource listed by the event. When omitted, the action is applied to all target resources of the event.

--name -n

The name of the VMScaleSetLifecycleHookEvent.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

The name of the VM scale set.

Property Value
Parameter group: Resource Id Arguments
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.

--verbose

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

Property Value
Default value: False

az vmss lifecycle-hook-event list

Preview

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

List a list of virtual machine scale set lifecycle hook events created for a virtual machine scale set resource.

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

Examples

Gets a list of all lifecycle hook events in a virtual machine scale set.

az vmss lifecycle-hook-event list --resource-group RG01 --vmss-name VMSS01

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

Preview

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

Reject a virtual machine scale set lifecycle hook event.

az vmss lifecycle-hook-event reject [--acquire-policy-token]
                                    [--change-reference]
                                    [--ids]
                                    [--instance-ids]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]
                                    [--vmss-name]

Examples

Reject all target resources of a lifecycle hook event.

az vmss lifecycle-hook-event reject --vmss-name MyVmss -g MyRg --name {eventGuid}

Reject a subset of target resources.

az vmss lifecycle-hook-event reject --vmss-name MyVmss -g MyRg --name {eventGuid} --instance-ids 0 1 2

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

Property Value
Parameter group: Resource Id Arguments
--instance-ids

Space-separated list of identifiers for target resources in the lifecycle hook event. For a scale-set-level event such as UpgradeAutoOSScheduling, specify the VM scale set name. For an instance-level event such as UpgradeAutoOSRollingBatchStarting, specify decimal instance IDs for a Uniform scale set (e.g. 0 1 2) or VM names for a Flexible scale set. Each identifier must correspond to a target resource listed by the event. When omitted, the action is applied to all target resources of the event.

--name -n

The name of the VMScaleSetLifecycleHookEvent.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

The name of the VM scale set.

Property Value
Parameter group: Resource Id Arguments
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.

--verbose

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

Property Value
Default value: False

az vmss lifecycle-hook-event show

Preview

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

Get a virtual machine scale set lifecycle hook event.

az vmss lifecycle-hook-event show [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]
                                  [--vmss-name]

Examples

Get a virtual machine scale set lifecycle hook event.

az vmss lifecycle-hook-event show --resource-group RG01 --vmss-name VMSS01 --name 2e2e3046-f85f-4966-8fd2-5fd7bf6ea717

Optional Parameters

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

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

Property Value
Parameter group: Resource Id Arguments
--name -n

The name of the VMScaleSetLifecycleHookEvent.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

The name of the VM scale set.

Property Value
Parameter group: Resource Id Arguments
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.

--verbose

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

Property Value
Default value: False

az vmss lifecycle-hook-event update

Preview

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

Update a virtual machine scale set lifecycle hook event.

az vmss lifecycle-hook-event update [--acquire-policy-token]
                                    [--action-state {Approved, Rejected}]
                                    [--change-reference]
                                    [--ids]
                                    [--instance-ids]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]
                                    [--vmss-name]
                                    [--wait-until]

Examples

Approve all target resources of a lifecycle hook event.

az vmss lifecycle-hook-event update --vmss-name MyVmss -g MyRg --name {eventGuid} --action-state Approved

Approve a subset of target resources (Uniform decimal instance ids or Flex VM names).

az vmss lifecycle-hook-event update --vmss-name MyVmss -g MyRg --name {eventGuid} --instance-ids 0 1 2 --action-state Approved

Delay the event deadline.

az vmss lifecycle-hook-event update --vmss-name MyVmss -g MyRg --name {eventGuid} --wait-until "2026-05-08T11:00:00Z"

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

State of the lifecycle hook for the target resource. The customer can patch this property to move the lifecycle hook to a terminal state.

Property Value
Accepted values: Approved, Rejected
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--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.

Property Value
Parameter group: Resource Id Arguments
--instance-ids

Space-separated list of identifiers for target resources in the lifecycle hook event. For a scale-set-level event such as UpgradeAutoOSScheduling, specify the VM scale set name. For an instance-level event such as UpgradeAutoOSRollingBatchStarting, specify decimal instance IDs for a Uniform scale set (e.g. 0 1 2) or VM names for a Flexible scale set. Each identifier must correspond to a target resource listed by the event. When omitted, the action is applied to all target resources of the event.

--name -n

The name of the VMScaleSetLifecycleHookEvent.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

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

Property Value
Parameter group: Resource Id Arguments
--subscription

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

The name of the VM scale set.

Property Value
Parameter group: Resource Id Arguments
--wait-until

Specifies the exact UTC timestamp in ISO 8601 format till which the event would remain in the current lifecycle state waiting for an action from the customer. Beyond this timestamp, the platform will apply the defaultAction for the event.

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.

--verbose

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

Property Value
Default value: False