-
Notifications
You must be signed in to change notification settings - Fork 4k
[Az.Network] Updated New-AzNetworkWatcherPacketCaptureV2 command and added a new sub command 'New-AzPacketCaptureSettingsConfig' for Network watcher Packet capture include ring buffer change. #27880
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
base: main
Are you sure you want to change the base?
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 pull request updates the Packet Capture commands by introducing a new subcommand (New-AzPacketCaptureSettingsConfig) to encapsulate capture settings and by modifying New-AzNetworkWatcherPacketCaptureV2 to support ring buffer configurations via new parameters. Key changes include:
- Adding a new cmdlet to generate capture settings objects.
- Updating Packet Capture V2 to accept ContinuousCapture, CaptureSettings, and LocalPath parameters.
- Adjusting help files, tests, and command mappings to incorporate the new functionality.
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
tools/StaticAnalysis/Exceptions/Az.Network/SignatureIssues.csv | Updated signature exceptions for New-AzNetworkWatcherPacketCaptureV2 to flag naming convention issues. |
tools/StaticAnalysis/Exceptions/Az.Network/ExampleIssues.csv | Added new example entries for New-AzPacketCaptureSettingsConfig. |
src/Network/Network/help/New-AzPacketCaptureSettingsConfig.md | New help file documenting the new subcommand. |
src/Network/Network/help/New-AzNetworkWatcherPacketCaptureV2.md | Updated help file reflecting new parameters and example with ring buffer capture. |
src/Network/Network/NetworkWatcher/PacketCapture/NewPacketCaptureSettingsCommand.cs | New implementation for creating packet capture settings objects. |
src/Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs | Modified to add support for ContinuousCapture, CaptureSettings, and LocalPath parameters. |
src/Network/Network/Models/PSPacketCaptureSettings.cs | New model supporting file count, file size, and session time limit settings. |
src/Network/Network/ChangeLog.md | Updated to mention new commands and parameter additions. |
src/Network/Network/Az.Network.psd1 | Updated command exports to include the new subcommand. |
src/Network/Network.Test/ScenarioTests/NetworkWatcherAPITests.ps1 & cs | Added tests validating the new capture settings functionality. |
src/Accounts/Accounts/Utilities/CommandMappings.json | Included the new command mapping for New-AzPacketCaptureSettingsConfig. |
Comments suppressed due to low confidence (2)
tools/StaticAnalysis/Exceptions/Az.Network/SignatureIssues.csv:462
- The exception message flags the 'CaptureSettings' parameter naming for New-AzNetworkWatcherPacketCaptureV2. Consider revising the parameter name to use a singular noun for consistency, or update the enforced naming convention if appropriate.
+"Az.Network","Microsoft.Azure.Commands.Network.NewAzureNetworkWatcherPacketCaptureCommandV2","New-AzNetworkWatcherPacketCaptureV2","1","8410","Parameter CaptureSettings of cmdlet New-AzNetworkWatcherPacketCaptureV2 does not follow the enforced naming convention of using a singular noun for a parameter name.","Consider using a singular noun for the parameter name."
src/Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs:308
- There is an inconsistency in parameter naming between 'LocalFilePath' and 'LocalPath'. Consolidate these names to a single consistent identifier to avoid confusion and improve clarity in both the cmdlet implementation and its documentation.
packetCaptureProperties.StorageLocation.FilePath = this.LocalFilePath;
...Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs
Outdated
Show resolved
Hide resolved
...Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs
Outdated
Show resolved
Hide resolved
...Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs
Outdated
Show resolved
Hide resolved
...Network/Network/NetworkWatcher/PacketCapture/NewAzureNetworkWatcherPacketCaptureCommandV2.cs
Outdated
Show resolved
Hide resolved
src/Network/Network/NetworkWatcher/PacketCapture/NewPacketCaptureSettingsCommand.cs
Show resolved
Hide resolved
src/Network/Network/help/New-AzNetworkWatcherPacketCaptureV2.md
Outdated
Show resolved
Hide resolved
src/Network/Network/help/New-AzNetworkWatcherPacketCaptureV2.md
Outdated
Show resolved
Hide resolved
src/Network/Network/help/New-AzNetworkWatcherPacketCaptureV2.md
Outdated
Show resolved
Hide resolved
/azp run azure-powershell - security-tools |
Azure Pipelines successfully started running 1 pipeline(s). |
Please do not merge this PR for now, getting reviewed by NW team. |
Description
Modified the existing Packet capture command include ring buffer change, in order to that, created a new sub command for capture settings,


Example:
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.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/Network/Network/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.