Skip to content

ProxyAgent support in Compute #27936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 3, 2025
Merged

ProxyAgent support in Compute #27936

merged 23 commits into from
Jul 3, 2025

Conversation

grizzlytheodore
Copy link
Member

@grizzlytheodore grizzlytheodore commented Jun 11, 2025

Description

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

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

Copy link

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

@grizzlytheodore grizzlytheodore marked this pull request as ready for review June 21, 2025 20:35
@Copilot Copilot AI review requested due to automatic review settings June 21, 2025 20:35
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for the Metadata Security Protocol (ProxyAgent) on virtual machines and VM scale sets by introducing new parameters, cmdlets, and wiring through the compute strategies and VMSS creation logic.

  • Added -EnableProxyAgent to New-AzVM and New-AzVmss and -ProxyAgentKeyIncarnationId to Update-AzVmssVM cmdlet help
  • Implemented Set-AzVMProxyAgentSetting and Set-AzVmssProxyAgentSetting cmdlets
  • Updated compute strategies and manual VMSS creation to propagate and conditionally apply the proxy agent settings

Reviewed Changes

Copilot reviewed 12 out of 16 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Compute/Compute/help/*.md Added ProxyAgent parameters and help placeholders
src/Compute/Compute/VirtualMachine/Config/SetAzVMProxyAgentSetting.cs Implemented Set-AzVMProxyAgentSetting cmdlet
src/Compute/Compute/Strategies/ComputeRp/*.cs Extended strategy methods to accept and assign enableProxyAgent
src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs Refactored VMSS creation, introduced helper methods, and added ProxyAgent wiring
src/Compute/Compute/Common/ConstantStringTypes.cs Added HyperVGenerations constants
src/Compute/Compute/ChangeLog.md Documented upcoming release changes
src/Compute/Compute/Az.Compute.psd1 Exported new cmdlets
Comments suppressed due to low confidence (10)

src/Compute/Compute/help/Set-AzVmssProxyAgentSetting.md:11

  • The synopsis placeholder is still present. Please provide a concise one-line summary of this cmdlet's purpose.
{{ Fill in the Synopsis }}

src/Compute/Compute/help/Set-AzVMProxyAgentSetting.md:22

  • The description placeholder is still present. Please add a brief explanation of what this cmdlet does and when to use it.
{{ Fill in the Description }}

src/Compute/Compute/help/Update-AzVmssVM.md:174

  • Grammar: change to 'Increasing the value of this parameter allows users to reset the key used for securing the communication channel between guest and host.'
Increase the value of this parameter allows users to reset the key used for securing communication channel between guest and host.

src/Compute/Compute/VirtualMachine/Config/SetAzVMProxyAgentSetting.cs:28

  • Class name does not match the cmdlet noun. Rename to SetAzVMProxyAgentSetting for consistency with the exported cmdlet name.
    public class SetAzureVMProxySetting : Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet

src/Compute/Compute/help/New-AzVmss.md:42

  • The syntax block omits a type for -EnableProxyAgent. It should include <SwitchParameter> (or <Boolean>) for consistency.
 [-SkuProfileAllocationStrategy <String>] [-EnableProxyAgent] [-DefaultProfile <IAzureContextContainer>]

src/Compute/Compute/help/New-AzVM.md:33

  • The syntax block omits a type for -EnableProxyAgent. Please specify <SwitchParameter> for clarity and help generation.
 [-AlignRegionalDisksToVMZone] [-EnableProxyAgent] [-DefaultProfile <IAzureContextContainer>]

src/Compute/Compute/ChangeLog.md:25

  • Changelog references incorrect cmdlet names. It should list Set-AzVmssProxyAgentSetting and Set-AzVMProxyAgentSetting to match the actual exports.
* Added new cmdlets `Set-AzVmssProxyAgent` and `Set-AzVMProxyAgent` to set the proxy agent settings for VM and VMSS.`

src/Compute/Compute/Strategies/ComputeRp/VirtualMachineStrategy.cs:161

  • Unconditionally instantiating SecurityProfile may send empty profiles when no security or proxy settings are set. Consider restoring a conditional check so SecurityProfile is only created when needed.
                        SecurityProfile = new SecurityProfile

src/Compute/Compute/Strategies/ComputeRp/VirtualMachineScaleSetStrategy.cs:112

  • Similar to VM strategy, SecurityProfile is always instantiated. Wrap in a condition or preserve null when no settings (including enableProxyAgent) are provided.
                            SecurityProfile = new SecurityProfile

src/Compute/Compute/Manual/VirtualMachineScaleSetCreateOrUpdateMethod.cs:457

  • References to DefaultPortRangeSize and FirstPortRangeStart are unresolved: ensure these constants are defined or imported, or restore the original literal values.
                        FirstPortRangeStart + i * DefaultPortRangeSize))

@grizzlytheodore grizzlytheodore changed the title Feature/cplat msp compute ProxyAgent support in Compute Jun 22, 2025
@grizzlytheodore
Copy link
Member Author

Added test, but tested more locally with @hmyan90
and further usage doc created: https://msazure.visualstudio.com/One/_wiki/wikis/One.wiki/714617/MSP-via-PowerShell-CLI

@vidai-msft vidai-msft removed their assignment Jun 24, 2025
@YanaXu YanaXu added the Compute label Jun 25, 2025
@YanaXu YanaXu self-assigned this Jun 25, 2025
@YanaXu
Copy link
Contributor

YanaXu commented Jun 25, 2025

@grizzlytheodore, please fix the CI errors.

Copy link

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

@grizzlytheodore
Copy link
Member Author

requesting OOB release for this along with
#27987

@YanaXu YanaXu merged commit 85f8737 into main Jul 3, 2025
13 checks passed
@YanaXu YanaXu deleted the feature/cplat-mspCompute branch July 3, 2025 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants