Skip to content

[Compute] Adding Scheduledevents to VM and VMSS#29123

Merged
thomas-temby merged 20 commits into
mainfrom
scheduledevents
Jun 29, 2026
Merged

[Compute] Adding Scheduledevents to VM and VMSS#29123
thomas-temby merged 20 commits into
mainfrom
scheduledevents

Conversation

@haagha

@haagha haagha commented Jan 30, 2026

Copy link
Copy Markdown
Member

Description

https://github.com/Azure/azure-powershell-cmdlet-review-pr/issues/1511

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

Haider Agha 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.
@azure-client-tools-bot-prd

Copy link
Copy Markdown
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -ScheduledEventsApiVersion and -EnableAllInstancesDown parameters 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>

Comment thread src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 Outdated
Comment thread src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.cs
Comment thread src/Compute/Compute/help/New-AzVM.md Outdated
Comment thread src/Compute/Compute/help/Update-AzVmss.md Outdated
Comment thread src/Compute/Compute/help/Update-AzVM.md Outdated
Comment thread src/Compute/Compute/help/Update-AzAvailabilitySet.md Outdated
Copilot AI review requested due to automatic review settings February 3, 2026 16:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 19 out of 21 changed files in this pull request and generated 3 comments.

Comment thread src/Compute/Compute/help/New-AzVmss.md Outdated
Comment thread src/Compute/Compute.Test/ScenarioTests/AvailabilitySetTests.ps1 Outdated

@isra-fel isra-fel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, please see the comments inline, and resolve the conflicts. THanks

Comment thread src/Compute/Compute/help/New-AzVM.md
Comment thread src/Compute/Compute/help/Update-AzAvailabilitySet.md Outdated
@teresaritorto teresaritorto added this to the Az 16.1.0 (07/07/2026) milestone Jun 2, 2026
Haider Agha and others added 2 commits June 17, 2026 13:44
# Conflicts:
#	src/Compute/Compute/ChangeLog.md
… -EnableAllInstancesDown across VM, VMSS, and AvailabilitySet

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 17, 2026 18:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 26 changed files in this pull request and generated 9 comments.

Comment thread src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs Outdated
Comment thread src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs Outdated
Comment thread src/Compute/Compute/VirtualMachine/Operation/NewAzureVMCommand.cs
@thomas-temby

Copy link
Copy Markdown
Contributor

Hi @haagha,

Can you please action the comments by copilot, or justify why the comment is invalid.

Haider Agha and others added 2 commits June 24, 2026 14:02
…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>
Copilot AI review requested due to automatic review settings June 25, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 26 changed files in this pull request and generated 6 comments.

Comment thread src/Compute/Compute/VirtualMachine/Operation/NewAzureVMCommand.cs
Comment thread src/Compute/Compute/help/New-AzVmss.md
Haider Agha and others added 2 commits June 25, 2026 08:48
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…mss help

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 25, 2026 12:59
@haagha

haagha commented Jun 25, 2026

Copy link
Copy Markdown
Member Author

@thomas-temby all comments have been addressed

@haagha haagha requested review from thomas-temby and removed request for YanaXu and dolauli June 25, 2026 13:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 26 changed files in this pull request and generated 1 comment.

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>
Comment thread src/Compute/Compute.Test/ScenarioTests/StrategiesVirtualMachineTests.ps1 Outdated
Comment thread src/Compute/Compute/ChangeLog.md Outdated
…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>
Copilot AI review requested due to automatic review settings June 26, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 22 out of 26 changed files in this pull request and generated 1 comment.

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 thomas-temby merged commit eb510d7 into main Jun 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants