Preserve VerifyClientAuthMode in Application Gateway client auth configuration#29854
Preserve VerifyClientAuthMode in Application Gateway client auth configuration#29854paraboys wants to merge 4 commits into
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Thank you for your contribution @paraboys! We will review the pull request and get back to you soon. |
|
@microsoft-github-policy-service agree |
There was a problem hiding this comment.
Pull request overview
This PR addresses an Application Gateway idempotency issue in Az.Network by adding the missing VerifyClientAuthMode field to the PowerShell model and ensuring it round-trips correctly between PowerShell and the Network SDK model during read/modify/write operations.
Changes:
- Added
VerifyClientAuthModetoPSApplicationGatewayClientAuthConfiguration. - Updated AutoMapper mappings in
NetworkResourceManagerProfileto mapVerifyClientAuthModeboth PS→SDK and SDK→PS. - Preserved the client auth mode value during conversions to prevent unintended drift (e.g.,
Passthroughreverting toStrict).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Network/Network/Models/PSApplicationGatewayClientAuthConfiguration.cs |
Adds the missing VerifyClientAuthMode property to the PS model so the value can be retained across conversions. |
src/Network/Network/Common/NetworkResourceManagerProfile.cs |
Extends AutoMapper mappings to include VerifyClientAuthMode in both directions (PS↔SDK). |
| { | ||
| public bool? VerifyClientCertIssuerDN { get; set; } | ||
| public string VerifyClientRevocation { get; set; } | ||
| public string VerifyClientAuthMode { get; set; } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| cfg.CreateMap<CNM.PSApplicationGatewayClientAuthConfiguration,MNM.ApplicationGatewayClientAuthConfiguration>() | ||
| .ForMember( | ||
| dest => dest.VerifyClientCertIssuerDn, | ||
| opt => opt.MapFrom(src => src.VerifyClientCertIssuerDN) | ||
| ) | ||
| .ForMember( | ||
| dest => dest.VerifyClientAuthMode, | ||
| opt => opt.MapFrom(src => src.VerifyClientAuthMode) | ||
| ); |
| public bool? VerifyClientCertIssuerDN { get; set; } | ||
| public string VerifyClientRevocation { get; set; } | ||
| public string VerifyClientAuthMode { get; set; } |
| public class PSApplicationGatewayClientAuthConfiguration | ||
| { | ||
| public bool? VerifyClientCertIssuerDN { get; set; } | ||
| public string VerifyClientRevocation { get; set; } | ||
| public string VerifyClientAuthMode { get; set; } |
There was a problem hiding this comment.
Thanks for the suggestion. The reported issue (#29540) is caused by the missing property in the PowerShell model and the SDK↔PS mappings during Get-AzApplicationGateway/Set-AzApplicationGateway round-trips. NewObject() is not part of that flow, so I kept this PR focused on the reported issue. I can address cmdlet parameter support separately if needed
| cfg.CreateMap<CNM.PSApplicationGatewayClientAuthConfiguration, MNM.ApplicationGatewayClientAuthConfiguration>() | ||
| .ForMember( | ||
| dest => dest.VerifyClientCertIssuerDn, | ||
| opt => opt.MapFrom(src => src.VerifyClientCertIssuerDN) | ||
| ) | ||
| .ForMember( | ||
| dest => dest.VerifyClientAuthMode, | ||
| opt => opt.MapFrom(src => src.VerifyClientAuthMode) | ||
| ); |
VeryEarly
left a comment
There was a problem hiding this comment.
please revisit changes in NetworkResourceManagerProfile.cs. The diff shouldn't be the entire file
|
meanwhile please also update |
|
Hi @VeryEarly , thanks for the review and feedback. I created a new PR (#29861) with a clean minimal diff that addresses the feedback regarding the full-file changes in Could you please review the new PR instead? I'll close this PR. |
Description
This PR fixes the missing
VerifyClientAuthModeproperty in the PowerShell model for Application Gateway client authentication configuration.Changes made
VerifyClientAuthModeproperty toPSApplicationGatewayClientAuthConfiguration.PSApplicationGatewayClientAuthConfiguration→ApplicationGatewayClientAuthConfigurationApplicationGatewayClientAuthConfiguration→PSApplicationGatewayClientAuthConfigurationVerifyClientAuthModeis preserved during conversions between PowerShell and SDK models.Impact
Previously,
VerifyClientAuthModewas not available in the PowerShell model, causing the value to be lost during PowerShell object conversions. As a result, Application Gateway configurations usingPassthroughmode could unintentionally be updated to the defaultStrictmode during read-modify-write operations.This change preserves the original
VerifyClientAuthModevalue and prevents unintended configuration changes.Fixes #29540.
Mandatory Checklist
General release
Public preview
Private preview
Engineering build
No need for a release
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdappropriately (if required).