Az.Compute: add -ProcessorMode support across VM/VMSS create/config/update cmdlets - #30012
Draft
Haider Agha (haagha) with Copilot wants to merge 2 commits into
Draft
Az.Compute: add -ProcessorMode support across VM/VMSS create/config/update cmdlets#30012Haider Agha (haagha) with Copilot wants to merge 2 commits into
-ProcessorMode support across VM/VMSS create/config/update cmdlets#30012Haider Agha (haagha) with Copilot wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Co-authored-by: haagha <64601174+haagha@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add compute cmdlets for turbo on/off
Az.Compute: add Aug 14, 2026
-ProcessorMode support across VM/VMSS create/config/update cmdlets
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 19 changed files in this pull request and generated no new comments.
Suppressed comments (4)
src/Compute/Compute/VirtualMachine/Operation/UpdateAzureVMCommand.cs:169
ProcessorModeis a free-form string and currently allows-ProcessorMode ''(empty string). Because the code treats "bound" parameters as intended to be sent to the service, an empty string can result in invalid requests and inconsistent behavior vs other call paths that treat null/empty as "not set". Add[ValidateNotNullOrEmpty]to prevent empty input.
[Parameter(
Mandatory = false,
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies processor frequency behavior.")]
[PSArgumentCompleter("Deterministic", "Opportunistic")]
public string ProcessorMode { get; set; }
src/Compute/Compute/VirtualMachine/Operation/NewAzureVMCommand.cs:420
ProcessorModecurrently accepts an empty string (e.g.,-ProcessorMode '') which would be treated as a bound value and can produce an invalid request body. Add[ValidateNotNullOrEmpty]to fail fast and keep behavior consistent with other string parameters in this cmdlet.
[PSArgumentCompleter("Deterministic", "Opportunistic")]
public string ProcessorMode { get; set; }
src/Compute/Compute/VirtualMachine/Config/NewAzureVMConfigCommand.cs:203
ProcessorModeallows empty-string input, which can later be serialized into the VM config and sent to the service as an invalid value. Add[ValidateNotNullOrEmpty]so users can’t pass-ProcessorMode ''.
ValueFromPipelineByPropertyName = true,
HelpMessage = "Specifies processor frequency behavior.")]
[PSArgumentCompleter("Deterministic", "Opportunistic")]
public string ProcessorMode { get; set; }
src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs:242
ProcessorModeaccepts empty string values, which are treated as explicitly provided and can lead to invalid requests. Add[ValidateNotNullOrEmpty]to align with other string parameters and fail fast.
HelpMessage = "Specifies processor frequency behavior for VM instances in the scale set model.")]
[PSArgumentCompleter("Deterministic", "Opportunistic")]
public string ProcessorMode { get; set; }
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.
This change adds first-class
ProcessorModesupport (Deterministic/Opportunistic) to Az.Compute VM and VMSS cmdlet surfaces, aligned with Compute API2026-04-01behavior. The parameter is available on create/config/update flows and maps tohardwareProfile.processorModeonly when explicitly supplied.Cmdlet surface updates
-ProcessorMode <string>with argument completer values to:New-AzVMConfig,New-AzVM,Update-AzVMNew-AzVmssConfig,New-AzVmss,Update-AzVmssRequest/model mapping
HardwareProfile.ProcessorModewhen bound.VirtualMachineProfile.HardwareProfile.ProcessorModewhen bound.Docs and user guidance
-ProcessorModesrc/Compute/Compute/ChangeLog.mdfor upcoming release.Scenario coverage wiring
[Fact]registrations to validate:Verification Checklist
SYNTAXsection and in alphabetical order in thePARAMETERSsection.Az.Compute.psd1(CmdletsToExport, alphabetical order).$null/empty inputs validated per[ValidateNotNullOrEmpty]or other validation attributes).Get-*call to confirm the values persisted..ps1scenario function is wired into the.csfile as a[Fact]check-in test.ChangeLog.mdupdated with a concise, user-focused entry under## Upcoming Release.