Azure / Azure/azure-cli

bug in az consumption

Open
#29,468 7 comments 2 reactions 0 assignees View on GitHub
act-codegen-extensibility-squad bug consumption customer-reported Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.