Get-AzVmssLifecycleHookEvent
Lists or retrieves lifecycle hook events for a Virtual Machine Scale Set (VMSS).
Syntax
ListParameterSet (Default)
Get-AzVmssLifecycleHookEvent
-ResourceGroupName <String>
-VMScaleSetName <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
GetParameterSet
Get-AzVmssLifecycleHookEvent
-ResourceGroupName <String>
-VMScaleSetName <String>
-Name <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The Get-AzVmssLifecycleHookEvent cmdlet lists all lifecycle hook events for a virtual machine scale set (VMSS) or retrieves a specific event by name (GUID). Lifecycle hook events are created by the platform when configured hooks fire during Auto OS Upgrade phases.
Events have a Properties.State of either 'Active' (waiting for a customer response) or 'Completed'.
Examples
Example 1: List all lifecycle hook events for a VMSS
Get-AzVmssLifecycleHookEvent -ResourceGroupName 'myRg' -VMScaleSetName 'myVmss'
This example lists all lifecycle hook events for the specified VMSS.
Example 2: Get a specific event by name
Get-AzVmssLifecycleHookEvent -ResourceGroupName 'myRg' -VMScaleSetName 'myVmss' -Name 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'
This example retrieves a specific lifecycle hook event by its GUID name.
Example 3: Filter to active events only
Get-AzVmssLifecycleHookEvent -ResourceGroupName 'myRg' -VMScaleSetName 'myVmss' |
Where-Object { $_.Properties.State -eq 'Active' }
This example lists only the active lifecycle hook events.
Example 4: Approve all active events via pipeline
Get-AzVmssLifecycleHookEvent -ResourceGroupName 'myRg' -VMScaleSetName 'myVmss' |
Where-Object { $_.Properties.State -eq 'Active' } |
Update-AzVmssLifecycleHookEvent -ActionState Approved
This example retrieves all active events and approves each one through the pipeline.
Parameters
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Name
The name (GUID) of the lifecycle hook event to retrieve. When omitted, all events for the VMSS are listed.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
GetParameterSet
| Position: | 2 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-ResourceGroupName
The name of the resource group.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 0 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
-VMScaleSetName
The name of the VM scale set.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | 1 |
| Mandatory: | True |
| Value from pipeline: | False |
| Value from pipeline by property name: | True |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.