Skip to content

bug in az consumption  #29468

@increff-megananthan-k

Description

@increff-megananthan-k

Describe the bug

using az consumption is giving errors.

Related command

az consumption usage list --start-date 2024-06-01 --end-date 2024-06-30

Errors

az consumption usage list --start-date 2024-06-01 --end-date 2024-06-30
This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
The command failed with an unexpected error. Here is the traceback:
'usageStart'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 714, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 46, in next
curr_page, self._next_link = self._extract_result()
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
result = list([transform_usage_output(item) for item in result])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in
result = list([transform_usage_output(item) for item in result])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
usageStart = parser.parse(result['usageStart'])
~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues

Issue script & Debug output

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: 'usageStart'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 714, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 46, in next
curr_page, self._next_link = self._extract_result()
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
result = list([transform_usage_output(item) for item in result])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in
result = list([transform_usage_output(item) for item in result])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
usageStart = parser.parse(result['usageStart'])
~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'
az_command_data_logger: 'usageStart'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 714, in _run_job
result = list(result)
^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_paging.py", line 46, in next
curr_page, self._next_link = self._extract_result()
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
result = list([transform_usage_output(item) for item in result])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in
result = list([transform_usage_output(item) for item in result])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.60.0/libexec/lib/python3.11/site-packages/azure/cli/command_modules/consumption/custom.py", line 95, in transform_usage_output
usageStart = parser.parse(result['usageStart'])
~~~~~~^^^^^^^^^^^^^^
KeyError: 'usageStart'

Expected behavior

when --debug i am getting the correct response but getting a error after that in the same command.

Environment Summary

azure-cli 2.62.0

core 2.62.0
telemetry 1.1.0

Extensions:
arcdata 1.5.13
costmanagement 0.3.0

Dependencies:
msal 1.28.1
azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.62.0/libexec/bin/python'

Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Service AttentionThis issue is responsible by Azure service team.act-codegen-extensibility-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.consumptioncustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions