-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Network] az network watcher flow-log: Add --record-types parameter
#32490
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
Conversation
…est_nw_flow_log.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…est_nw_flow_log.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
️✔️AzureCLI-FullTest
|
|
| rule | cmd_name | rule_message | suggest_message |
|---|---|---|---|
| network watcher flow-log create | cmd network watcher flow-log create added parameter record_types |
||
| network watcher flow-log update | cmd network watcher flow-log update added parameter record_types |
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
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 adds support for the --record-types parameter to Azure CLI's flow log commands, allowing users to filter network traffic logs based on flow states (Begin, Continue, End, Deny). The feature is implemented by updating the API version from 2024-03-01 to 2025-03-01 across multiple flow log command files.
- Added
--record-typesparameter toflow-log createandflow-log updatecommands - Updated API version to 2025-03-01 for create, update, show, delete, and wait operations
- Added unit test for flow log creation with record-types filtering
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test_nw_flow_log.py | Adds test case test_nw_flow_log_create_vnetfl_with_record_types to verify flow log creation with record-types parameter |
| _create.py | Adds --record-types parameter, updates API version to 2025-03-01, includes identity schema enhancements, and adds example for record-types usage |
| _update.py | Adds --record-types parameter to update command, updates API version to 2025-03-01, and adds example for record-types usage |
| _show.py | Updates API version to 2025-03-01, adds record_types field to response schema, and includes identity schema enhancements |
| _delete.py | Updates API version to 2025-03-01 for consistency with other flow log commands |
| _wait.py | Updates API version to 2025-03-01, adds record_types field and identity schema enhancements to response schema |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_nw_flow_log.py
Outdated
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/network/tests/latest/test_nw_flow_log.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/watcher/flow_log/_create.py
Show resolved
Hide resolved
src/azure-cli/azure/cli/command_modules/network/aaz/latest/network/watcher/flow_log/_update.py
Show resolved
Hide resolved
…est_nw_flow_log.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
az network watcher flow-log: Add --record-types parameter
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Azure/aaz#911 |
Related command
az network watcher flow-log create --location centraluseuap --resource-group riddhi_rg3 --name recordtype-FlowLog --vnet vnet-centraluseuap --storage-account riddhicentraluseuap --record-types "B,E"az network watcher flow-log update --location centraluseuap --resource-group riddhi_rg3 --name recordtype-FlowLog --vnet vnet-centraluseuap --storage-account riddhicentraluseuap --record-types "B,C"az network watcher flow-log show --location centraluseuap --name recordtype-FlowLogDescription
This PR introduces a new optional field, "record-types," for the creation and update of the Flowlogs resource. Necessary validations for this field have already been implemented in NRP. Unit tests for this feature have been added as part of this PR.
Additionally, screenshots of the testing performed, beyond unit tests, are included below.
Testing Guide
Help command shows the new field and its proper explanation:

az network watcher flow-log create --location centraluseuap --resource-group riddhi_rg3 --name recordtype-FlowLog --vnet vnet-centraluseuap --storage-account riddhicentraluseuap --record-types "B,E"az network watcher flow-log show --location centraluseuap --name recordtype-FlowLogaz network watcher flow-log update --location centraluseuap --resource-group riddhi_rg3 --name recordtype-FlowLog --vnet vnet-centraluseuap --storage-account riddhicentraluseuap --record-types "B,C"History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.