[Network] az network application-gateway waf-policy managed-rule rule-set update: Allow updating rule group without rule IDs - #33871
Merged
Ethan Yang (necusjz) merged 1 commit intoAug 12, 2026
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
microsoft-github-policy-service
Bot
requested review from
Yu Chen (jsntcy),
Ethan Yang (necusjz) and
Yong Zhang (yonzhan)
August 11, 2026 05:42
Member
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Collaborator
|
Network |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 3 pipeline(s). |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the az network application-gateway waf-policy managed-rule rule-set update command behavior to match its documentation by allowing --group-name to be specified without any --rule entries, creating an empty rule-group override that disables all rules in that group (fixing #33271).
Changes:
- Relaxed CLI validation to allow
--group-namewithout--rule, while still rejecting--rulewithout--group-name. - Updated the managed rule-set update implementation to create a rule-group override whenever
--group-nameis provided (even when no rules are specified). - Added a live test case (and recording) verifying that a group-only update produces an empty
rulesoverride and correspondingcomputedDisabledRules.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/network/custom.py | Allows creating a rule-group override on update even when no rule IDs are provided. |
| src/azure-cli/azure/cli/command_modules/network/_validators.py | Updates validation to permit --group-name without --rule, and improves the error message for the invalid opposite case. |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py | Adds a live scenario assertion for group-only update behavior (empty override rules + computed disabled rules). |
| src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_app_gateway_waf_policy_compute_disabled_rule.yaml | Updates the recording to include the new group-only update interaction. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+3425
to
+3429
| self.cmd('network application-gateway waf-policy managed-rule rule-set update -g {rg} ' | ||
| '--policy-name {policy_name} ' | ||
| '--type {policy_type} ' | ||
| '--version {policy_version} ' | ||
| '--group-name {empty_rule_group_name}', |
Member
There was a problem hiding this comment.
thanks for making user's input a test case,
az network application-gateway waf-policy managed-rule rule-set update --policy-name Maruthi3rdWAF-eastus2euap -g MaruthiRGNRP2-eastus2euap --type Microsoft_DefaultRuleSet --version 2.1 --group-name LFIaz network application-gateway waf-policy managed-rule rule-set update: Allow updating a rule group without rule IDsaz network application-gateway waf-policy managed-rule rule-set update: Allow updating rule group without rule IDs
Ethan Yang (necusjz)
approved these changes
Aug 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related command
az network application-gateway waf-policy managed-rule rule-set updateDescription
Fixes #33271
Allow
--group-nameto be provided without--rule, as documented. This creates an empty rule group override and disables all rules in that group. Providing--rulewithout--group-nameremains invalid.Testing Guide
azdev test test_network_app_gateway_waf_policy_compute_disabled_rule --liveHistory Notes
This 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.