Skip to content

Upgrade front-door WAF policy commands to API version 2025-11-01#9804

Merged
necusjz merged 1 commit intoAzure:mainfrom
Ptnan7:front-door-2025-11-01
Apr 21, 2026
Merged

Upgrade front-door WAF policy commands to API version 2025-11-01#9804
necusjz merged 1 commit intoAzure:mainfrom
Ptnan7:front-door-2025-11-01

Conversation

@Ptnan7
Copy link
Copy Markdown
Member

@Ptnan7 Ptnan7 commented Apr 20, 2026

  • Updated AAZ-generated code for waf-policy create/delete/list/show/update/wait
  • Updated managed-rule-definition list
  • New enum values: JA4 (MatchVariable), AsnMatch/ClientFingerprint (Operator)
  • New ManagedRuleSetException model with exceptionsList support
  • LRO final-state-via changed from azure-async-operation to location
  • Updated test recordings

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings April 20, 2026 23:40
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Apr 20, 2026

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 20, 2026

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

@github-actions
Copy link
Copy Markdown
Contributor

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).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

@github-actions
Copy link
Copy Markdown
Contributor

Hi @Ptnan7

⚠️ Release Requirements

Module: front-door

  • ⚠️ Please update VERSION to be 2.1.1 in src/front-door/setup.py

Notes

@github-actions github-actions Bot added the release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. label Apr 20, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the front-door Azure CLI extension’s Front Door WAF policy commands and tests to align with the Microsoft.Network API version 2025-11-01, including new managed-rules capabilities.

Changes:

  • Bump extension version to 2.2.0 and add release notes for the API upgrade.
  • Update AAZ-generated WAF policy + managed rule definition command implementations to 2025-11-01 (including exceptionsList, new enum values, and LRO polling changes).
  • Refresh scenario test recordings to match the updated API behavior and responses.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/front-door/setup.py Bumps extension version to 2.2.0.
src/front-door/HISTORY.rst Adds 2.2.0 changelog entries for the API upgrade and new features.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/managed_rule_definition/_list.py Updates managed rule set definition listing command to 2025-11-01.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/_wait.py Updates wait command schema/API version; adds managed-rules exceptions schema.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/_update.py Updates update command API version, enums, exceptionsList support, and LRO polling mode.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/_show.py Updates show command schema/API version; adds exceptionsList support.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/_list.py Updates list command API version and response schema; adds exceptionsList support.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/_delete.py Updates delete command API version and LRO polling mode; updates error format.
src/front-door/azext_front_door/aaz/latest/network/front_door/waf_policy/_create.py Updates create command API version, enums, exceptionsList support, and LRO polling mode.
src/front-door/azext_front_door/tests/latest/recordings/test_waf_policy_managed_rules_sensitivity.yaml Re-recorded interactions for managed rules sensitivity scenarios against 2025-11-01.
src/front-door/azext_front_door/tests/latest/recordings/test_waf_policy_managed_rules.yaml Re-recorded interactions for managed rules scenarios against 2025-11-01.
src/front-door/azext_front_door/tests/latest/recordings/test_waf_log_scrubbing.yaml Re-recorded interactions for log scrubbing scenarios against 2025-11-01.
src/front-door/azext_front_door/tests/latest/recordings/test_waf_exclusions.yaml Re-recorded interactions for exclusions scenarios against 2025-11-01.
src/front-door/azext_front_door/tests/latest/recordings/test_waf_captcha.yaml Re-recorded interactions for captcha scenarios against 2025-11-01.

Comment thread src/front-door/HISTORY.rst Outdated
Comment on lines +10 to +12
* Add `ManagedRuleSetException` support with `exceptionsList` in managed rules
* Add subscription-level WAF policy list
* LRO polling changed from azure-async-operation to location
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

The changelog entry says “Add subscription-level WAF policy list”, but the PR changes shown only update the existing resource-group scoped waf-policy list command (it still requires --resource-group). Please either adjust this bullet to describe the actual change, or include the missing subscription-scope list implementation in this PR.

Copilot uses AI. Check for mistakes.
Comment on lines 18 to 22
"""List all available managed rule sets.

:example: List Policies ManagedRuleSets in a Resource Group
az network front-door waf-policy managed-rule-definition list
"""
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

This example/help text is inconsistent with the command behavior: managed-rule-definition list has no resource-group parameter and lists managed rule sets (not policies). Please update the example description so it reflects subscription-scope listing of managed rule sets.

Copilot uses AI. Check for mistakes.

:example: Update specific policy
az network front-door waf-policy update --resource-group rg1 --policy-name Policy1 --location WestUs --enabled-state Enabled --mode Prevention --redirect-url http://www.bing.com --custom-block-response-status-code 429 --custom-block-response-body PGh0bWw+CjxoZWFkZXI+PHRpdGxlPkhlbGxvPC90aXRsZT48L2hlYWRlcj4KPGJvZHk+CkhlbGxvIHdvcmxkCjwvYm9keT4KPC9odG1sPg== --request-body-check Disabled --javascript-challenge-expiration-in-minutes 30 --captcha-expiration-in-minutes 30 --log-scrubbing "{state:Enabled,scrubbing-rules:[{match-variable:RequestIPAddress,selector-match-operator:EqualsAny,selector:null,state:Enabled}]}" --custom-rules "{rules:[{name:Rule1,priority:1,rule-type:RateLimitRule,rate-limit-threshold:1000,match-conditions:[{match-variable:RemoteAddr,operator:IPMatch,match-value:[192.168.1.0/24,10.0.0.0/24]}],action:Block},{name:Rule2,priority:2,rule-type:MatchRule,match-conditions:[{match-variable:RemoteAddr,operator:GeoMatch,match-value:[CH]},{match-variable:RequestHeader,operator:Contains,selector:UserAgent,match-value:[windows],transforms:[Lowercase]}],action:Block},{name:Rule3,priority:1,rule-type:RateLimitRule,rate-limit-threshold:1000,match-conditions:[{match-variable:RemoteAddr,operator:ServiceTagMatch,match-value:[AzureBackup,AzureBotService]}],action:CAPTCHA}]}" --managed-rules "{managed-rule-sets:[{rule-set-type:DefaultRuleSet,rule-set-version:1.0,rule-set-action:Block,exclusions:[{matchVariable:RequestHeaderNames,selectorMatchOperator:Equals,selector:User-Agent}],rule-group-overrides:[{rule-group-name:SQLI,exclusions:[{matchVariable:RequestCookieNames,selectorMatchOperator:StartsWith,selector:token}],rules:[{rule-id:942100,enabled-state:Enabled,action:Redirect,exclusions:[{matchVariable:QueryStringArgNames,selectorMatchOperator:Equals,selector:query}]},{rule-id:942110,enabled-state:Disabled}]}]},{rule-set-type:Microsoft_HTTPDDoSRuleSet,rule-set-version:1.0,rule-group-overrides:[{rule-group-name:ExcessiveRequests,rules:[{rule-id:500100,enabled-state:Enabled,action:Block,sensitivity:High}]}]}]}" --sku Premium_AzureFrontDoor
:example: Creates specific policy
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

The update command’s docstring/example header says “Creates specific policy”, which is misleading for an update operation. Please change it to “Updates …” (and ensure the example still matches the update semantics).

Suggested change
:example: Creates specific policy
:example: Updates specific policy

Copilot uses AI. Check for mistakes.
@yonzhan yonzhan requested a review from necusjz April 21, 2026 00:03
@necusjz necusjz added skip-cal-version act-quality-productivity-squad and removed release-version-block Updates do not qualify release version rules. NOTE: please do not edit it manually. labels Apr 21, 2026
@necusjz
Copy link
Copy Markdown
Member

necusjz commented Apr 21, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@Ptnan7 Ptnan7 force-pushed the front-door-2025-11-01 branch from 9f72ba8 to 29a8d9d Compare April 21, 2026 01:06
@necusjz
Copy link
Copy Markdown
Member

necusjz commented Apr 21, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 2 pipeline(s).

@necusjz necusjz merged commit 253f5b9 into Azure:main Apr 21, 2026
24 checks passed
@azclibot
Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ front-door-2.2.0 ] : https://dev.azure.com/msazure/One/_build/results?buildId=161166679&view=results

@Ptnan7 Ptnan7 deleted the front-door-2025-11-01 branch April 22, 2026 00:23
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.

5 participants