[Compute] Adding Scheduledevents to VM and VMSS#29123
Merged
Merged
Conversation
added 3 commits
January 28, 2026 17:33
…zVM, and Update-AzVmss cmdlets - Introduced `-ScheduledEventsApiVersion` to specify the API version for Scheduled Events configuration. - Added `-EnableAllInstancesDown` to auto-approve Scheduled Events when all instances are down. - Updated related help documentation for cmdlets to reflect new parameters. - Enhanced handling of Scheduled Events policy in the cmdlet implementations.
… scheduledevents
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Scheduled Events configuration support to Az.Compute VM/VMSS (and Availability Set) cmdlets by introducing two new parameters that populate ScheduledEventsPolicy in the corresponding ARM payloads.
Changes:
- Added
-ScheduledEventsApiVersionand-EnableAllInstancesDownparameters to VM/VMSS/Availability Set create/update cmdlets and wired them into request models. - Updated generated/help markdown to document the new parameters.
- Added new scenario tests (and one new recording) intended to validate the behavior.
Reviewed changes
Copilot reviewed 23 out of 25 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Compute/Compute/help/Update-AzVmss.md | Documents new Scheduled Events parameters for Update-AzVmss (and adds -ProgressAction entry). |
| src/Compute/Compute/help/Update-AzVM.md | Documents new Scheduled Events parameters for Update-AzVM (and adds -ProgressAction entry). |
| src/Compute/Compute/help/Update-AzAvailabilitySet.md | Documents new Scheduled Events parameters for Update-AzAvailabilitySet (and adds -ProgressAction entry). |
| src/Compute/Compute/help/New-AzVmss.md | Documents new Scheduled Events parameters for New-AzVmss and updates syntax block. |
| src/Compute/Compute/help/New-AzVM.md | Documents new Scheduled Events parameters for New-AzVM and updates syntax block. |
| src/Compute/Compute/VirtualMachine/Operation/UpdateAzureVMCommand.cs | Adds parameters and populates ScheduledEventsPolicy for VM update calls. |
| src/Compute/Compute/VirtualMachine/Operation/NewAzureVMCommand.cs | Adds parameters and passes Scheduled Events inputs through strategy-based VM creation; also forwards ScheduledEventsPolicy from PSVirtualMachine to the SDK model. |
| src/Compute/Compute/Strategies/ComputeRp/VirtualMachineStrategy.cs | Extends strategy VM config builder to construct ScheduledEventsPolicy during VM creation. |
| src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs | Extends strategy VMSS config builder to construct ScheduledEventsPolicy during VMSS creation. |
| src/Compute/Compute/Models/PSVirtualMachine.cs | Adds ScheduledEventsPolicy property to the PowerShell VM model. |
| src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs | Adds Scheduled Events parameters to VMSS create cmdlet path and passes them into strategy config. |
| src/Compute/Compute/Manual/PSVirtualMachineScaleSet.cs | Adds ScheduledEventsPolicy property to the PowerShell VMSS model. |
| src/Compute/Compute/Generated/VirtualMachineScaleSet/VirtualMachineScaleSetUpdateMethod.cs | Adds Scheduled Events parameters to Update-AzVmss and applies them only in PUT path (not PATCH). |
| src/Compute/Compute/ChangeLog.md | Adds an Upcoming Release note about the new parameters. |
| src/Compute/Compute/AvailabilitySets/UpdateAzureAvailabilitySetCommand.cs | Adds parameters and populates ScheduledEventsPolicy for availability set updates. |
| src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.AvailabilitySetTests/TestAvailabilitySetScheduledEventsPolicy.json | Adds a recording for the new availability set Scheduled Events scenario. |
| src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.ps1 | Adds a VM Scheduled Events scenario test script. |
| src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.cs | Registers the new VM Scheduled Events scenario test for check-in runs. |
| src/Compute/Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.ps1 | Adds a VMSS Scheduled Events scenario test script. |
| src/Compute/Compute.Test/ScenarioTests/VirtualMachineScaleSetTests.cs | Registers the new VMSS Scheduled Events scenario test for check-in runs. |
| src/Compute/Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.ps1 | Adds a strategy-based New-AzVM SimpleParameterSet Scheduled Events scenario test script. |
| src/Compute/Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.cs | Registers the new strategy-based Scheduled Events scenario test for check-in runs. |
| src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 | Adds an availability set Scheduled Events scenario test script. |
| src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.cs | Registers the new availability set Scheduled Events scenario test for check-in runs. |
Comments suppressed due to low confidence (1)
src/Compute/Compute/help/New-AzVmss.md:651
- The -HighSpeedInterconnectPlacement parameter help no longer lists its accepted values (e.g., None/Trunk). Other cmdlets in this module include an "Accepted values:" line for constrained strings; please restore that here to avoid losing important guidance.
### -HighSpeedInterconnectPlacement
Specifies the high speed interconnect placement for the virtual machine scale set.
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
</details>
added 2 commits
February 3, 2026 11:46
isra-fel
reviewed
Feb 18, 2026
isra-fel
left a comment
Member
There was a problem hiding this comment.
Hi, please see the comments inline, and resolve the conflicts. THanks
# Conflicts: # src/Compute/Compute/ChangeLog.md
… -EnableAllInstancesDown across VM, VMSS, and AvailabilitySet Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
Hi @haagha, Can you please action the comments by copilot, or justify why the comment is invalid. |
…on and drop ProgressAction help placeholder Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…Update-AzAvailabilitySet PUT path Address Copilot review: copy ScheduledEventsPolicy from the input object so piping (e.g. Get-AzVM | Update-AzVM) without re-specifying the parameters no longer clears an existing configuration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…mss help Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
@thomas-temby all comments have been addressed |
Resolve conflicts by keeping both ScheduledEvents and VMSS Lifecycle Hooks additive changes across ChangeLog, PSVirtualMachineScaleSet, Strategies tests, and help docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
audreyttt
reviewed
Jun 26, 2026
…e for VM - Tighten Test-SimpleNewVmScheduledEventsPolicy to assert the policy is returned on create (API now echoes scheduledEventsPolicy at api-version 2025-11-01), mirroring the VMSS test. - Extend the test to cover Update-AzVM by toggling EnableAllInstancesDown and asserting the change is persisted. - Re-record the session against live Azure. - Trim implementation-detail bullets from the Compute ChangeLog per review. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
audreyttt
approved these changes
Jun 26, 2026
Comment on lines
+484
to
+488
| [Parameter( | ||
| Mandatory = false, | ||
| ValueFromPipelineByPropertyName = true, | ||
| HelpMessage = "Specifies the api-version to determine which Scheduled Events configuration schema version will be delivered. Format: YYYY-MM-DD. For available API versions, see https://learn.microsoft.com/rest/api/compute/scheduled-events.")] | ||
| public string ScheduledEventsApiVersion { get; set; } |
thomas-temby
approved these changes
Jun 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/1511
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.