Skip to content

AZ CLI Upgrade to 2.77.0 should have fixed error from ticket 31954 on command 'az network application-gateway waf-policy custom-rule create' #32047

@Tedkata

Description

@Tedkata

Describe the bug

Follow up to this ticket #31954
Error persists. Even though release 2.77,0 should have fixed it.

Related command

az network application-gateway waf-policy custom-rule create --action Allow --name ${{ env.someRandom}} --policy-name ${{ env.someRandom2}} --priority ${{ env.someRandom3}} --resource-group ${{ env.someRandom4}} --rule-type MatchRule --match-conditions '[{"variables":[{"variable_name":"RemoteAddr"}],"operator":"IPMatch","values":["${{ steps.ip.outputs.ipv4 }}/32"]}]'

Errors

ERROR: The command failed with an unexpected error. Here is the traceback:
ERROR: Expect <class 'str'>, got 931130 (<class 'int'>)
Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 49, in process_data
json_data = shell_safe_json_parse(data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/util.py", line 575, in shell_safe_json_parse
return json.loads(json_or_dict_string, strict=strict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/json/init.py", line 339, in loads
raise TypeError(f'the JSON object must be str, bytes or bytearray, '
TypeError: the JSON object must be str, bytes or bytearray, not int

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/opt/az/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_command.py", line 155, in call
return self._handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_policy/custom_rule/_create.py", line 37, in _handler
self._execute_operations()
File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_policy/custom_rule/_create.py", line 197, in _execute_operations
self.WebApplicationFirewallPoliciesGet(ctx=self.ctx)()
File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_policy/custom_rule/_create.py", line 256, in call
return self.on_200(session)
^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/command_modules/network/aaz/latest/network/application_gateway/waf_policy/custom_rule/_create.py", line 314, in on_200
self.ctx.set_var(
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_command_ctx.py", line 84, in set_var
self.vars[name] = data
~~~~~~~~~^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 79, in setitem
self._data[name] = attr_schema.process_data(data, key=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 286, in process_data
value[key] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 79, in setitem
self._data[name] = attr_schema.process_data(data, key=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 286, in process_data
value[key] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 79, in setitem
self._data[name] = attr_schema.process_data(data, key=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 286, in process_data
value[key] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 79, in setitem
self._data[name] = attr_schema.process_data(data, key=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 462, in process_data
value[idx] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 316, in setitem
self._data[idx] = item_schema.process_data(data, key=idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 286, in process_data
value[key] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 79, in setitem
self._data[name] = attr_schema.process_data(data, key=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 462, in process_data
value[idx] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 316, in setitem
self._data[idx] = item_schema.process_data(data, key=idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 286, in process_data
value[key] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 79, in setitem
self._data[name] = attr_schema.process_data(data, key=name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 462, in process_data
value[idx] = sub_data
~~~~~^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_value.py", line 316, in setitem
self._data[idx] = item_schema.process_data(data, key=idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/az/lib/python3.12/site-packages/azure/cli/core/aaz/_field_type.py", line 51, in process_data
raise AAZInvalidValueError('Expect {}, got {} ({})'.format(self.DataType, data, type(data)))
azure.cli.core.aaz.exceptions.AAZInvalidValueError: Expect <class 'str'>, got 931130 (<class 'int'>)

Issue script & Debug output

--debug

Expected behavior

To create the custom WAF rule.

Environment Summary

using github actions' cli version, should be latest 2.77.0

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamNetworkaz network vnet/lb/nic/dns/etc...OKR CandidateThis label is used to track how many GitHub issues we have resolved for OKR purpose.Possible-SolutionSimilar-Issuecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions