Skip to content

Preserve VerifyClientAuthMode in Application Gateway client auth configuration#29854

Open
paraboys wants to merge 4 commits into
Azure:mainfrom
paraboys:paraboys-patch-1
Open

Preserve VerifyClientAuthMode in Application Gateway client auth configuration#29854
paraboys wants to merge 4 commits into
Azure:mainfrom
paraboys:paraboys-patch-1

Conversation

@paraboys

Copy link
Copy Markdown

Description

This PR fixes the missing VerifyClientAuthMode property in the PowerShell model for Application Gateway client authentication configuration.

Changes made

  • Added the missing VerifyClientAuthMode property to PSApplicationGatewayClientAuthConfiguration.
  • Updated AutoMapper mappings between:
    • PSApplicationGatewayClientAuthConfigurationApplicationGatewayClientAuthConfiguration
    • ApplicationGatewayClientAuthConfigurationPSApplicationGatewayClientAuthConfiguration
  • Ensured that VerifyClientAuthMode is preserved during conversions between PowerShell and SDK models.

Impact

Previously, VerifyClientAuthMode was not available in the PowerShell model, causing the value to be lost during PowerShell object conversions. As a result, Application Gateway configurations using Passthrough mode could unintentionally be updated to the default Strict mode during read-modify-write operations.

This change preserves the original VerifyClientAuthMode value 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.md and reviewed the following information:

  • Updated ChangeLog.md appropriately (if required).
  • Regenerated markdown help files (not required since there is no cmdlet API change).
  • Added/updated test coverage for the change.
  • Did not manually adjust the module version.

Copilot AI review requested due to automatic review settings July 15, 2026 18:07
@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.

@azure-pipelines

Copy link
Copy Markdown
Contributor
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution @paraboys! We will review the pull request and get back to you soon.

@paraboys

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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

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 VerifyClientAuthMode to PSApplicationGatewayClientAuthConfiguration.
  • Updated AutoMapper mappings in NetworkResourceManagerProfile to map VerifyClientAuthMode both PS→SDK and SDK→PS.
  • Preserved the client auth mode value during conversions to prevent unintended drift (e.g., Passthrough reverting to Strict).

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).

Comment thread src/Network/Network/Common/NetworkResourceManagerProfile.cs Outdated
Comment thread src/Network/Network/Common/NetworkResourceManagerProfile.cs Outdated
{
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>
Copilot AI review requested due to automatic review settings July 15, 2026 18: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 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines +1452 to +1460
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)
);
Comment on lines 20 to +22
public bool? VerifyClientCertIssuerDN { get; set; }
public string VerifyClientRevocation { get; set; }
public string VerifyClientAuthMode { get; set; }
Copilot AI review requested due to automatic review settings July 15, 2026 19:17

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 2 out of 2 changed files in this pull request and generated 2 comments.

Comment on lines 18 to +22
public class PSApplicationGatewayClientAuthConfiguration
{
public bool? VerifyClientCertIssuerDN { get; set; }
public string VerifyClientRevocation { get; set; }
public string VerifyClientAuthMode { get; set; }

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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

Comment on lines +1452 to +1460
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 VeryEarly self-assigned this Jul 19, 2026

@VeryEarly VeryEarly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please revisit changes in NetworkResourceManagerProfile.cs. The diff shouldn't be the entire file

@VeryEarly

Copy link
Copy Markdown
Collaborator

meanwhile please also update https://github.com/paraboys/azure-powershell/blob/paraboys-patch-1/src/Network/Network/ChangeLog.md
briefly summarise release note for this change in past tense under Upcoming Release

@paraboys

Copy link
Copy Markdown
Author

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 NetworkResourceManagerProfile.cs.

Could you please review the new PR instead? I'll close this PR.

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.

AzApplicationGateway: Missing VerifyClientAuthMode in Az.Network PowerShell model causes unintended config changes

3 participants