From 9701edac7dfec0718274e5920087bf26ce5b7609 Mon Sep 17 00:00:00 2001 From: necusjz Date: Thu, 7 Jul 2022 15:28:30 +0800 Subject: [PATCH 1/3] add validation for WAF custom rule condition --- src/azure-cli/azure/cli/command_modules/network/custom.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index 924d90ab5ac..731adb36af5 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -1932,7 +1932,12 @@ def delete_waf_custom_rule(cmd, client, resource_group_name, policy_name, rule_n # region ApplicationGatewayWAFPolicyRuleMatchConditions def add_waf_custom_rule_match_cond(cmd, client, resource_group_name, policy_name, rule_name, - match_variables, operator, match_values, negation_condition=None, transforms=None): + match_variables, operator, match_values=None, negation_condition=None, transforms=None): + if operator.lower() == "any" and match_values is not None: + raise ArgumentUsageError("Any operator does not require --match-values.") + if operator.lower() != "any" and match_values is None: + raise ArgumentUsageError("Non-any operator requires --match-values.") + MatchCondition = cmd.get_models('MatchCondition') waf_policy = client.get(resource_group_name, policy_name) custom_rule = find_child_item(waf_policy, rule_name, path='custom_rules', key_path='name') From f6e17188499607a0de7c61c66bbd616ccb83dc80 Mon Sep 17 00:00:00 2001 From: necusjz Date: Thu, 7 Jul 2022 15:28:51 +0800 Subject: [PATCH 2/3] add test cases --- ...t_network_app_gateway_waf_custom_rule.yaml | 226 ++++++++++-------- .../tests/latest/test_network_commands.py | 6 + 2 files changed, 130 insertions(+), 102 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_app_gateway_waf_custom_rule.yaml b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_app_gateway_waf_custom_rule.yaml index a442df9a850..ec9fb7edb86 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_app_gateway_waf_custom_rule.yaml +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/recordings/test_network_app_gateway_waf_custom_rule.yaml @@ -13,12 +13,12 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-resource/21.1.0b1 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_app_gateway_waf_custom_rule_000001?api-version=2021-04-01 response: body: - string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001","name":"cli_test_app_gateway_waf_custom_rule_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-05-12T14:00:46Z"},"properties":{"provisioningState":"Succeeded"}}' + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001","name":"cli_test_app_gateway_waf_custom_rule_000001","type":"Microsoft.Resources/resourceGroups","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2022-07-07T07:25:31Z"},"properties":{"provisioningState":"Succeeded"}}' headers: cache-control: - no-cache @@ -27,13 +27,15 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:49 GMT + - Thu, 07 Jul 2022 07:25:35 GMT expires: - '-1' pragma: - no-cache strict-transport-security: - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding x-content-type-options: - nosniff status: @@ -58,13 +60,13 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"430dd3b1-12bf-4e2c-b8f9-4d5f511de6d0\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"f4313f97-f894-4ba1-8db6-c56027f3c772\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"customRules\": [],\r\n \"policySettings\": {\r\n @@ -78,7 +80,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/3871f8b8-f905-406d-8d27-738775cc3bc7?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/0cb6038b-b5f8-4497-ab66-9e2a2060f0fb?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -86,7 +88,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:53 GMT + - Thu, 07 Jul 2022 07:25:38 GMT expires: - '-1' pragma: @@ -99,9 +101,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 75458cf1-7db5-4560-888a-f95f71252fe7 + - 55c90ff9-50bb-40af-963b-9a264fa90929 x-ms-ratelimit-remaining-subscription-writes: - - '1183' + - '1197' status: code: 201 message: Created @@ -119,13 +121,13 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"91e7e949-2be9-4e38-9129-07d61abac7d4\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"e5455482-87d8-446f-9c00-9d2971e11708\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [],\r\n \"policySettings\": {\r\n @@ -143,9 +145,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:54 GMT + - Thu, 07 Jul 2022 07:25:39 GMT etag: - - W/"91e7e949-2be9-4e38-9129-07d61abac7d4" + - W/"e5455482-87d8-446f-9c00-9d2971e11708" expires: - '-1' pragma: @@ -155,10 +157,14 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - fce6afc6-28f5-4c5a-9175-2d7e7b1c7ec1 + - 37ce578b-c4b5-4faf-8da6-a8353e12b90e status: code: 200 message: OK @@ -176,13 +182,13 @@ interactions: ParameterSetName: - -g --policy-name -n --priority --action --rule-type User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"91e7e949-2be9-4e38-9129-07d61abac7d4\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"e5455482-87d8-446f-9c00-9d2971e11708\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [],\r\n \"policySettings\": {\r\n @@ -200,9 +206,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:55 GMT + - Thu, 07 Jul 2022 07:25:40 GMT etag: - - W/"91e7e949-2be9-4e38-9129-07d61abac7d4" + - W/"e5455482-87d8-446f-9c00-9d2971e11708" expires: - '-1' pragma: @@ -212,10 +218,14 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 8c04b546-856f-4537-bf3b-45638f94a1aa + - 88c9f1d8-110d-44d8-a1ed-abd9d294516e status: code: 200 message: OK @@ -243,13 +253,13 @@ interactions: ParameterSetName: - -g --policy-name -n --priority --action --rule-type User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"f7cbd4a9-c793-441d-a862-5348755d42d2\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"a548506f-3fc0-4d09-ab4b-9e721092c7a0\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -266,7 +276,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/9c8f0665-82ef-48f1-b8c6-5b6fa337cc95?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/92e3cbab-5eca-439d-a8a4-ed900d20c4da?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -274,7 +284,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:57 GMT + - Thu, 07 Jul 2022 07:25:41 GMT expires: - '-1' pragma: @@ -284,12 +294,16 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - f7a53215-199b-45da-a78e-7a316edc8950 + - b0889db0-c84a-4965-9ea4-3cf66a4e54fc x-ms-ratelimit-remaining-subscription-writes: - - '1182' + - '1198' status: code: 200 message: OK @@ -307,13 +321,13 @@ interactions: ParameterSetName: - -g -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"320aca74-9a3a-4f1a-a35a-ad64542f7f7e\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"48a87cc9-1e19-4acf-936d-6a3867b5513b\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -334,9 +348,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:58 GMT + - Thu, 07 Jul 2022 07:25:41 GMT etag: - - W/"320aca74-9a3a-4f1a-a35a-ad64542f7f7e" + - W/"48a87cc9-1e19-4acf-936d-6a3867b5513b" expires: - '-1' pragma: @@ -346,10 +360,14 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5774a19a-a3bb-4afd-be26-22e0b03d76fc + - 52bb8da3-e1ef-4c5e-9f49-8e953925207d status: code: 200 message: OK @@ -367,13 +385,13 @@ interactions: ParameterSetName: - -g --policy-name -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"320aca74-9a3a-4f1a-a35a-ad64542f7f7e\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"48a87cc9-1e19-4acf-936d-6a3867b5513b\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -394,9 +412,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:00:59 GMT + - Thu, 07 Jul 2022 07:25:42 GMT etag: - - W/"320aca74-9a3a-4f1a-a35a-ad64542f7f7e" + - W/"48a87cc9-1e19-4acf-936d-6a3867b5513b" expires: - '-1' pragma: @@ -406,10 +424,14 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - e05b4348-8246-479e-a792-ac3af0a11d90 + - 1e97a4fb-7602-4576-8915-8ed9cf00d124 status: code: 200 message: OK @@ -427,13 +449,13 @@ interactions: ParameterSetName: - -g --policy-name -n --match-variables --operator --values --transform User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"320aca74-9a3a-4f1a-a35a-ad64542f7f7e\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"48a87cc9-1e19-4acf-936d-6a3867b5513b\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -454,9 +476,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:01 GMT + - Thu, 07 Jul 2022 07:25:43 GMT etag: - - W/"320aca74-9a3a-4f1a-a35a-ad64542f7f7e" + - W/"48a87cc9-1e19-4acf-936d-6a3867b5513b" expires: - '-1' pragma: @@ -466,10 +488,14 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 22bbc504-104f-431d-acdc-2112bc5385a3 + - a6fa17df-eee5-4f7f-8aa9-6ada62d499b3 status: code: 200 message: OK @@ -499,13 +525,13 @@ interactions: ParameterSetName: - -g --policy-name -n --match-variables --operator --values --transform User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"b2264b0c-8104-4ceb-99c5-8abeae2d4fea\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"29ca8baf-400d-4fe6-b8cc-25fa475b6c9f\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -528,7 +554,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/8e3137cf-3c25-4241-a462-687755df0432?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/6f6c6cb8-752d-472b-8ebb-7975485e78b4?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -536,7 +562,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:02 GMT + - Thu, 07 Jul 2022 07:25:44 GMT expires: - '-1' pragma: @@ -546,12 +572,16 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 9c91acf3-3d8b-4842-9131-1a023b5c0016 + - b21d7301-5e95-4af5-b950-75d8184fb342 x-ms-ratelimit-remaining-subscription-writes: - - '1182' + - '1198' status: code: 200 message: OK @@ -569,13 +599,13 @@ interactions: ParameterSetName: - -g --policy-name -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"d4677861-1def-4d67-b7ff-d4c4496f5c8d\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"12ec8b0a-153d-4002-b5a3-945dc4ae535c\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -602,9 +632,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:04 GMT + - Thu, 07 Jul 2022 07:25:45 GMT etag: - - W/"d4677861-1def-4d67-b7ff-d4c4496f5c8d" + - W/"12ec8b0a-153d-4002-b5a3-945dc4ae535c" expires: - '-1' pragma: @@ -621,7 +651,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - d4a0a170-99fd-4147-933b-e43303b50f12 + - 2d50b106-fb21-47a1-8c74-13421757ba8b status: code: 200 message: OK @@ -639,13 +669,13 @@ interactions: ParameterSetName: - -g --policy-name -n --priority User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"d4677861-1def-4d67-b7ff-d4c4496f5c8d\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"12ec8b0a-153d-4002-b5a3-945dc4ae535c\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -672,9 +702,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:05 GMT + - Thu, 07 Jul 2022 07:25:46 GMT etag: - - W/"d4677861-1def-4d67-b7ff-d4c4496f5c8d" + - W/"12ec8b0a-153d-4002-b5a3-945dc4ae535c" expires: - '-1' pragma: @@ -691,7 +721,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 11da2060-53fc-4db5-9764-7817d9e9c0e1 + - 7b02c394-43bf-4b4a-ac31-13f33318e8ba status: code: 200 message: OK @@ -721,13 +751,13 @@ interactions: ParameterSetName: - -g --policy-name -n --priority User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"b21d3f5d-4bfc-46ee-a1b8-8f25e398bdd7\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"df6334b1-8967-49e3-b7e4-ed22fd7d88ad\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -750,7 +780,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/0ddb5fd3-4966-4c90-b60a-2d2d34e67582?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/7cbdf40a-93ab-4b4f-aa39-0dc769b3675f?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -758,7 +788,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:06 GMT + - Thu, 07 Jul 2022 07:25:46 GMT expires: - '-1' pragma: @@ -775,9 +805,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 82f4bbba-cae3-47ce-8798-a46ee6b0890e + - 8ff6dff9-dbb3-4dae-8fb6-aef378325416 x-ms-ratelimit-remaining-subscription-writes: - - '1195' + - '1198' status: code: 200 message: OK @@ -795,13 +825,13 @@ interactions: ParameterSetName: - -g --policy-name -n --match-variables --operator --values --transform User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"6979781c-3cbf-4b28-9b37-bdfa0a10c5fb\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"b36c8b7c-fc53-4374-b05f-63d7857a0fc3\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -828,9 +858,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:07 GMT + - Thu, 07 Jul 2022 07:25:47 GMT etag: - - W/"6979781c-3cbf-4b28-9b37-bdfa0a10c5fb" + - W/"b36c8b7c-fc53-4374-b05f-63d7857a0fc3" expires: - '-1' pragma: @@ -840,14 +870,10 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 64a32711-c890-44b5-a342-555c51ae430e + - d61bd1fe-8586-4f0f-b06f-77c5b9592a03 status: code: 200 message: OK @@ -879,13 +905,13 @@ interactions: ParameterSetName: - -g --policy-name -n --match-variables --operator --values --transform User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"937c9f1e-6b73-4d04-8a7b-aa1731529229\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"b00f8d46-32c5-4966-bc12-3ba7d39062cd\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -914,7 +940,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/98a2501e-85f1-46ce-a58c-32585b7806b7?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/937ebd39-344a-465f-afdd-32d647661aab?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -922,7 +948,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:08 GMT + - Thu, 07 Jul 2022 07:25:47 GMT expires: - '-1' pragma: @@ -932,16 +958,12 @@ interactions: - Microsoft-HTTPAPI/2.0 strict-transport-security: - max-age=31536000; includeSubDomains - transfer-encoding: - - chunked - vary: - - Accept-Encoding x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 3aa32638-59d9-4b56-a7ad-25816ec1bfc3 + - 84be5c84-a853-4640-b898-b2a83beed762 x-ms-ratelimit-remaining-subscription-writes: - - '1193' + - '1198' status: code: 200 message: OK @@ -959,13 +981,13 @@ interactions: ParameterSetName: - -g --policy-name -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"877d6920-aa84-47a9-99df-11b26e11e98b\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"971a63b1-b7d1-4f4b-8b5d-e2d10220ff58\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -998,9 +1020,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:09 GMT + - Thu, 07 Jul 2022 07:25:48 GMT etag: - - W/"877d6920-aa84-47a9-99df-11b26e11e98b" + - W/"971a63b1-b7d1-4f4b-8b5d-e2d10220ff58" expires: - '-1' pragma: @@ -1017,7 +1039,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - b454f840-a45d-4c9d-bb03-26dd63cd83f2 + - fe2e7ea7-94a8-40ac-8f80-8cd45dbb8d24 status: code: 200 message: OK @@ -1035,13 +1057,13 @@ interactions: ParameterSetName: - -g --policy-name -n --index User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"877d6920-aa84-47a9-99df-11b26e11e98b\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"971a63b1-b7d1-4f4b-8b5d-e2d10220ff58\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -1074,9 +1096,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:09 GMT + - Thu, 07 Jul 2022 07:25:49 GMT etag: - - W/"877d6920-aa84-47a9-99df-11b26e11e98b" + - W/"971a63b1-b7d1-4f4b-8b5d-e2d10220ff58" expires: - '-1' pragma: @@ -1093,7 +1115,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 5c8e2a60-96fb-42d6-a126-17fca8e0c140 + - 20d1e0f9-18d6-4ac4-a931-d66fbc9c275c status: code: 200 message: OK @@ -1123,13 +1145,13 @@ interactions: ParameterSetName: - -g --policy-name -n --index User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: PUT uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"004c457f-148c-4a47-9999-f169c7db8843\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"ce33d336-a0bd-4990-989e-82656efc932d\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Updating\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -1152,7 +1174,7 @@ interactions: azure-asyncnotification: - Enabled azure-asyncoperation: - - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/1fd6bb5e-6c01-47d1-ad28-e442344908e1?api-version=2021-08-01 + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/locations/westus/operations/c4b6bdeb-5c35-4b06-aab5-481e03cb661b?api-version=2021-08-01 cache-control: - no-cache content-length: @@ -1160,7 +1182,7 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:10 GMT + - Thu, 07 Jul 2022 07:25:50 GMT expires: - '-1' pragma: @@ -1177,9 +1199,9 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - 969fb18e-6515-4673-91b8-7d98740c56c9 + - ad9949e4-0d07-477f-94cd-7c874a46a84f x-ms-ratelimit-remaining-subscription-writes: - - '1189' + - '1198' status: code: 200 message: OK @@ -1197,13 +1219,13 @@ interactions: ParameterSetName: - -g --policy-name -n User-Agent: - - AZURECLI/2.36.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-network/20.0.0 Python/3.8.10 (Windows-10-10.0.19044-SP0) method: GET uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1?api-version=2021-08-01 response: body: string: "{\r\n \"name\": \"agp1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_app_gateway_waf_custom_rule_000001/providers/Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies/agp1\",\r\n - \ \"etag\": \"W/\\\"a5c16c4a-9d1b-4590-9525-3617d0463f85\\\"\",\r\n \"type\": + \ \"etag\": \"W/\\\"b73b2253-2ac8-4f9b-92c9-e8a5cd398ea5\\\"\",\r\n \"type\": \"Microsoft.Network/ApplicationGatewayWebApplicationFirewallPolicies\",\r\n \ \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n \"customRules\": [\r\n {\r\n \"name\": \"rule1\",\r\n @@ -1230,9 +1252,9 @@ interactions: content-type: - application/json; charset=utf-8 date: - - Thu, 12 May 2022 14:01:11 GMT + - Thu, 07 Jul 2022 07:25:51 GMT etag: - - W/"a5c16c4a-9d1b-4590-9525-3617d0463f85" + - W/"b73b2253-2ac8-4f9b-92c9-e8a5cd398ea5" expires: - '-1' pragma: @@ -1249,7 +1271,7 @@ interactions: x-content-type-options: - nosniff x-ms-arm-service-request-id: - - cf937dbd-277c-431f-9937-d57b21bae667 + - d615cc97-3d75-4368-b746-995e82f5ffde status: code: 200 message: OK diff --git a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py index d29d146992e..f395c67d96f 100644 --- a/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py +++ b/src/azure-cli/azure/cli/command_modules/network/tests/latest/test_network_commands.py @@ -2229,6 +2229,12 @@ def test_network_app_gateway_waf_custom_rule(self, resource_group): self.check('action', 'Log'), self.check('matchConditions | length(@)', 0) ]) + # validate match condition + from azure.cli.core.azclierror import ArgumentUsageError + with self.assertRaisesRegex(ArgumentUsageError, "Non-any operator requires --match-values."): + self.cmd("network application-gateway waf-policy custom-rule match-condition add -g {rg} " + "--policy-name {waf} -n {rule} " + "--match-variables RequestHeaders.value --operator Contains --transform lowercase") # add match condition to the previous created custom rule self.cmd('network application-gateway waf-policy custom-rule match-condition add -g {rg} ' From 59b646d834289a5341e12ecc88f964858de91fcf Mon Sep 17 00:00:00 2001 From: necusjz Date: Thu, 7 Jul 2022 15:51:35 +0800 Subject: [PATCH 3/3] fix style check --- src/azure-cli/azure/cli/command_modules/network/custom.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/azure-cli/azure/cli/command_modules/network/custom.py b/src/azure-cli/azure/cli/command_modules/network/custom.py index 731adb36af5..b5e61514ef2 100644 --- a/src/azure-cli/azure/cli/command_modules/network/custom.py +++ b/src/azure-cli/azure/cli/command_modules/network/custom.py @@ -1931,8 +1931,8 @@ def delete_waf_custom_rule(cmd, client, resource_group_name, policy_name, rule_n # region ApplicationGatewayWAFPolicyRuleMatchConditions -def add_waf_custom_rule_match_cond(cmd, client, resource_group_name, policy_name, rule_name, - match_variables, operator, match_values=None, negation_condition=None, transforms=None): +def add_waf_custom_rule_match_cond(cmd, client, resource_group_name, policy_name, rule_name, match_variables, operator, + match_values=None, negation_condition=None, transforms=None): if operator.lower() == "any" and match_values is not None: raise ArgumentUsageError("Any operator does not require --match-values.") if operator.lower() != "any" and match_values is None: