Skip to content

Conversation

Copy link

Copilot AI commented Nov 17, 2025

Description

Adds support for configuring Azure Scheduled Events policy on Virtual Machine Scale Sets, Virtual Machines, and Availability Sets. Implements two new optional parameters across six cmdlets to control scheduled events schema version and auto-approval behavior.

Parameters Added

Added to Update-AzVmss, New-AzVmss, Update-AzVM, New-AzVM, Update-AzAvailabilitySet, New-AzAvailabilitySet:

  • -ScheduledEventsApiVersion (string): Specifies API version for scheduled events schema (format: YYYY-MM-DD)
  • -EnableAllInstancesDown (bool?): Controls auto-approval when all VM instances are down

Maps to SDK model hierarchy:

ScheduledEventsPolicy
├── ScheduledEventsAdditionalPublishingTargets.EventGridAndResourceGraph.ScheduledEventsApiVersion
└── AllInstancesDown.AutomaticallyApprove

Implementation

  • Extended PowerShell models (PSVirtualMachineScaleSet, PSVirtualMachine, PSAvailabilitySet) with ScheduledEventsPolicy property
  • Implemented null-safe nested object initialization in all cmdlets
  • Handles both patch (Update) and put (New) operations consistently

Usage Example

# Configure scheduled events on VMSS
$vmss = Get-AzVmss -ResourceGroupName "rg" -VMScaleSetName "vmss"
Update-AzVmss -ResourceGroupName "rg" -Name "vmss" `
    -VirtualMachineScaleSet $vmss `
    -ScheduledEventsApiVersion "2025-04-01" `
    -EnableAllInstancesDown $true

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Updated src/Compute/Compute/ChangeLog.md under ## Upcoming Release with parameter descriptions
  • SHOULD regenerate markdown help files if there is cmdlet API change
    • Help file regeneration required (blocked by network connectivity to Azure DevOps feeds in current environment)
  • SHOULD have proper test coverage for changes in pull request
    • Test scenarios documented; execution blocked by build dependencies
  • SHOULD NOT adjust version of module manually in pull request
    • No version changes made

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • 1mcvsblobprodwus2174.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • 1n8vsblobprodwus2184.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • 2d2vsblobprodwus2127.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • 40vvsblobprodwus2135.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • 5azvsblobprodwus2162.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • 5o1vsblobprodwus2115.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • 6yfvsblobprodwus2121.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • 7q7vsblobprodwus2144.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • 7t8vsblobprodwus2168.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • 84hvsblobprodwus2148.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • 8wdvsblobprodwus2137.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • 9yyvsblobprodwus2157.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • b15vsblobprodwus2164.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • b53vsblobprodwus2154.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • ba0vsblobprodwus2130.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • balvsblobprodwus2129.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • cbvvsblobprodwus2131.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • cffvsblobprodwus218.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • d94vsblobprodwus2119.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • ezcvsblobprodwus2170.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • faxvsblobprodwus2122.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • g3xvsblobprodwus2151.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • i01vsblobprodwus216.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • ia4vsblobprodwus2112.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • isvvsblobprodwus2147.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • jhgvsblobprodwus2167.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • k4pvsblobprodwus2140.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • kafvsblobprodwus2165.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • km4vsblobprodwus2183.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • ldhvsblobprodwus2153.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • mt2vsblobprodwus2110.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • nudvsblobprodwus214.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • p2tvsblobprodwus2189.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • s8nvsblobprodwus2158.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • tn2vsblobprodwus2124.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • wlnvsblobprodwus2188.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • wztvsblobprodwus2155.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • x0dvsblobprodwus2111.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • xofvsblobprodwus2114.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/tools/VersionController/VersionController.Netcore.csproj -c Debug (dns block)
  • y5lvsblobprodwus2179.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • yf8vsblobprodwus212.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)
  • zt8vsblobprodwus2176.vsblob.vsassets.io
    • Triggering command: /usr/bin/dotnet build /home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Azure.PowerShell.sln -c Debug -fl /flp1:logFile=/home/REDACTED/work/azure-powershell/azure-powershell/artifacts/Build.log;verbosity=quiet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Az.Compute - ScheduledEventsPolicy Changes</issue_title>
<issue_description>

Guidelines

The purpose of the Azure PowerShell design review is to ensure that the cmdlets follow the same pattern across the Azure modules. An early design review reduces the risk of unnecessary implementation changes caused by a cmdlet syntax design change.

Please ensure your cmdlets comply with the design guidelines outlined in the PowerShell Design Guidelines document.

Please generate cmdlets syntax using GenerateCmdletDesignMarkdown.ps1 for review if your cmdlet is generated from API spec directly by Autorest.PowerShell.

If you just add parameter to existing cmdlets and parameter definition complies with guideline, the design review is not expected.

  • Have you read above statement?

    • { Yes }

Service Release Details

  • Is this an Embargoed Preview, A Public Preview, or a General Release?

    • Public Preview
  • What is the expected service release date?

    • Private Preview Began: 10/15
  • Which Powershell module are these changes being made in?

    • Compute

Contact Information

  • Main developer contacts (emails + github aliases)

    • Payal Gupta([payallnu@microsoft.com](mailto:payallnu@microsoft.com)), Avisha Jain ([avishajainmicrosoft.com](mailto:arpit.nand@microsoft.com)), Eric Radzikowski ([ericrad@microsoft.com](mailto:ericrad@microsoft.com), GitHub: EricRadzikowskiMSFT)
  • PM contact (email + github alias)

    • [wilsonadam@microsoft.com](mailto:wilsonadam@microsoft.com) GitHub: adwilso
  • Other people who should attend a design review (email)

    • [gtiwari@microsoft.com](mailto:gtiwari@microsoft.com)

High Level Scenarios

  • Describe how your feature is intended to be used by customers.

    `- Customers will need to set the 2 new properties on the VM/VMSS/AvSet profile. These properties will control if scheduled events (https://learn.microsoft.com/en-us/azure/virtual-machines/linux/scheduled-events) are delivered to additional endpoints (Azure resource graph and Event Grid) and how user initiated scheduled events are handled.
    Scheduled events are used by customers to detect upcoming availability impacts to their VMs and react accordingly. For example an typical event will tell customers about an upcoming maintenance operation on the host server their VM is sitting on. It will include the time and expected impact of the maintenance, giving the customer time to drain sessions and move the workload to a secondary VM if needed.

The usage for the PowerShell command will simply be setting/unsetting the value in the profile to opt the customer in or out of getting events. We expect the property to be set once and left for the lifetime of the VM.`

  • Piping scenarios / how these cmdlets are used with existing cmdlets

    • Don't expect the new flags t to be connected with any other commands. Customers still might pipe together commands to get the VMSS name for example, but that should be impacted by adding new optional parameters
  • Sample of end-to-end usage

    • Please provide comprehensive examples that don't assume additional setup. It helps the audience understand your feature.

    • `Enable support:
      Update-AzVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet" -VirtualMachineScaleSet $vmss --scheduled-events-api-version True --enable-allInstancesDown True

Disable support: Update-AzVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet" -VirtualMachineScaleSet $vmss --scheduled-events-api-version False--enable-allInstancesDown False

Update-AzAvailabilitySet and Update-AzVM should behave the same way.`

Syntax changes

Indicate if you are requesting an edit to existing cmdlets, adding new cmdlets, or both. Then edit the corresponding section below.

- Existing

New Cmdlet

List the new cmdlet names.

- NA

Changed cmdlet

List the names of the cmdlets that are being edited.

- Update-AzVmss
  • Set-AzVmss
  • Update-AzAvailabilitySet
  • Set-AzAvailabilitySet
  • Update-AzVM
  • Set-AzVM

List the new parameters for the cmdlet, the parameter types, and their allowed values if applicable.

-  For all the cmdlets we're looking to add the same 2 parameters. All 1 boolean values and 1 string value, and any combination of values for the 2 parameters is valid.

--ScheduledEventsApiVersion
--EnableAllInstancesDown
...

Custom agent used: Powershell PR agent
This agent creates a Powershell PR

  • Fixes Azure/azure-powershell-cmdlet-review-pr#1511

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI self-assigned this Nov 17, 2025
Copilot AI and others added 2 commits November 17, 2025 17:02
… cmdlets

Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Az.Compute scheduled events policy cmdlets Add ScheduledEventsPolicy parameters to VMSS, VM, and AvailabilitySet cmdlets Nov 17, 2025
Copilot AI requested a review from haagha November 17, 2025 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants