@@ -21,12 +21,15 @@ class Update(AAZCommand):
2121 az network front-door waf-policy update -g rg -n n1 --log-scrubbing "{scrubbing-rules:[{match-variable:QueryStringArgNames,selector-match-operator:EqualsAny}],state:Enabled}"
2222 az network front-door waf-policy update -g rg -n n1 --log-scrubbing scrubbing-rules[1]="{match-variable:RequestUri,selector-match-operator:Equals}"
2323 az network front-door waf-policy update -g rg -n n1 --log-scrubbing "{scrubbing-rules:[{match-variable:RequestBodyJsonArgNames,selector-match-operator:EqualsAny}],state:Enabled}" scrubbing-rules[1]="{match-variable:RequestUri,selector-match-operator:EqualsAny}"
24+
25+ :example: Update specific policy
26+ 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
2427 """
2528
2629 _aaz_info = {
27- "version" : "2025-03 -01" ,
30+ "version" : "2025-10 -01" ,
2831 "resources" : [
29- ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/frontdoorwebapplicationfirewallpolicies/{}" , "2025-03 -01" ],
32+ ["mgmt-plane" , "/subscriptions/{}/resourcegroups/{}/providers/microsoft.network/frontdoorwebapplicationfirewallpolicies/{}" , "2025-10 -01" ],
3033 ]
3134 }
3235
@@ -320,7 +323,7 @@ def _build_arguments_schema(cls, *args, **kwargs):
320323 _element .operator = AAZStrArg (
321324 options = ["operator" ],
322325 help = "Comparison type to use for matching with the variable value." ,
323- enum = {"Any" : "Any" , "BeginsWith" : "BeginsWith" , "Contains" : "Contains" , "EndsWith" : "EndsWith" , "Equal" : "Equal" , "GeoMatch" : "GeoMatch" , "GreaterThan" : "GreaterThan" , "GreaterThanOrEqual" : "GreaterThanOrEqual" , "IPMatch" : "IPMatch" , "LessThan" : "LessThan" , "LessThanOrEqual" : "LessThanOrEqual" , "RegEx" : "RegEx" },
326+ enum = {"Any" : "Any" , "BeginsWith" : "BeginsWith" , "Contains" : "Contains" , "EndsWith" : "EndsWith" , "Equal" : "Equal" , "GeoMatch" : "GeoMatch" , "GreaterThan" : "GreaterThan" , "GreaterThanOrEqual" : "GreaterThanOrEqual" , "IPMatch" : "IPMatch" , "LessThan" : "LessThan" , "LessThanOrEqual" : "LessThanOrEqual" , "RegEx" : "RegEx" , "ServiceTagMatch" : "ServiceTagMatch" },
324327 )
325328 _element .selector = AAZStrArg (
326329 options = ["selector" ],
@@ -442,6 +445,12 @@ def _build_arguments_schema(cls, *args, **kwargs):
442445 options = ["rule-id" ],
443446 help = "Identifier for the managed rule." ,
444447 )
448+ _element .sensitivity = AAZStrArg (
449+ options = ["sensitivity" ],
450+ help = "Describes the override sensitivity to be applied when rule matches." ,
451+ nullable = True ,
452+ enum = {"High" : "High" , "Low" : "Low" , "Medium" : "Medium" },
453+ )
445454
446455 exclusions = cls ._args_schema .managed_rules .managed_rule_sets .Element .rule_group_overrides .Element .rules .Element .exclusions
447456 exclusions .Element = AAZObjectArg (
@@ -573,7 +582,7 @@ def url_parameters(self):
573582 def query_parameters (self ):
574583 parameters = {
575584 ** self .serialize_query_param (
576- "api-version" , "2025-03 -01" ,
585+ "api-version" , "2025-10 -01" ,
577586 required = True ,
578587 ),
579588 }
@@ -672,7 +681,7 @@ def url_parameters(self):
672681 def query_parameters (self ):
673682 parameters = {
674683 ** self .serialize_query_param (
675- "api-version" , "2025-03 -01" ,
684+ "api-version" , "2025-10 -01" ,
676685 required = True ,
677686 ),
678687 }
@@ -835,6 +844,7 @@ def _update_instance(self, instance):
835844 _elements .set_prop ("enabledState" , AAZStrType , ".enabled_state" )
836845 _elements .set_prop ("exclusions" , AAZListType , ".exclusions" )
837846 _elements .set_prop ("ruleId" , AAZStrType , ".rule_id" , typ_kwargs = {"flags" : {"required" : True }})
847+ _elements .set_prop ("sensitivity" , AAZStrType , ".sensitivity" )
838848
839849 exclusions = _builder .get (".properties.managedRules.managedRuleSets[].ruleGroupOverrides[].rules[].exclusions" )
840850 if exclusions is not None :
@@ -1129,6 +1139,7 @@ def _build_schema_web_application_firewall_policy_read(cls, _schema):
11291139 serialized_name = "ruleId" ,
11301140 flags = {"required" : True },
11311141 )
1142+ _element .sensitivity = AAZStrType ()
11321143
11331144 exclusions = _schema_web_application_firewall_policy_read .properties .managed_rules .managed_rule_sets .Element .rule_group_overrides .Element .rules .Element .exclusions
11341145 exclusions .Element = AAZObjectType ()
0 commit comments