-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Properly set base policy id in azure firewall policy via pipe #28733
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
Properly set base policy id in azure firewall policy via pipe #28733
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this 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 fixes an issue where the base policy ID is incorrectly set when updating an Azure Firewall Policy using pipeline input. The fix extracts base policy information consistently whether the cmdlet receives input via parameter or pipeline.
Key Changes:
- Added a new
ExtractBasePolicy()helper method to properly handle base policy ID extraction from both parameter and pipeline input scenarios - Removed inline base policy handling logic that was causing the issue with piped input
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| SetAzureFirewallPolicyCommand.cs | Added ExtractBasePolicy() method to properly handle base policy ID extraction; replaced inline base policy handling with method call |
| AzureFirewallPolicyTests.ps1 | Added test function to verify base policy is correctly preserved when updating policies via pipeline |
| AzureFirewallPolicyTests.cs | Added test method wrapper to run the new PowerShell test scenario |
src/Network/Network/AzureFirewallPolicy/SetAzureFirewallPolicyCommand.cs
Outdated
Show resolved
Hide resolved
…Command.cs Co-authored-by: Copilot <[email protected]>
…ersmsft/azure-powershell into firewall/basepolicyserializebugfix
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Document bug fix for AzureFirewallPolicy in version 7.22.1.
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.