-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage start error using az consumption usage list on Azure CLI version 2.57.0 #28323
Comments
Thank you for opening this issue, we will look into it. |
Same issue here.
|
hi Everyone - I can confirm the same issue. I am currently running some tests using Azure DevOps Pipelines, and have prepared a pipeline that runs two jobs in parallel, both run the following command against two different subscriptions (service connections) under the same tenant:
I ran this command 6 times within the span of about 40 minutes:
Hope that sheds a bit of light and helps your troubleshooting efforts. |
Looks like it gives the response, but a closer look at the url shows that there's 2x usageEnd. First one should be of course usageStart. |
I've been facing this issue with my workflow that checks for the az consumption usage list :
|
I can confirm that the error still exists also in latest Azure CLI version 2.58.0. |
I'm facing the same issue using Azure CLI version 2.58.0 |
I am also facing the issue in |
As a workaround you can try an older version
|
Still there in 2.61.0 |
Experiencing it on 2.62.0 as well. |
Same here on... az version |
I might have found the issue on the following line:
The above line reads as follows: filter_from = "properties/usageEnd ge \'{}\'".format(start_date.strftime("%Y-%m-%dT%H:%M:%SZ")) Note that in the above line the filter from is using usageEnd instead of usageStart. The fixed line should read as follows: filter_from = "properties/usageStart ge \'{}\'".format(start_date.strftime("%Y-%m-%dT%H:%M:%SZ")) Is there someone around who can test the above code changes? |
While the usageEnd/usageStart noted above seems to indeed be a problem, I patched it manually on my install (now 2.63.0) and this error still happens. Down in the {
"id": "...",
"name": "...",
"accountName": "...",
"consumedService": "...",
"costCenter": "...",
"meterId": "...",
"product": "...",
"subscriptionName": "...",
"tags": {
"..."
},
"type": "..."
} |
Still there in 2.65.0 |
Issue still persists in current latest CLI version 2.67.0. I wish this would be fixed soon, as the cost management UI is quite painful to use at the moment, even if you just want to gather a simple total cost of multiple subscriptions. |
I am also facing the issue with the below cli version. Please try to fix it asap. It's quite painful to get the data manually from the portal for all the resources in each subscription for a tenant and I have multiple tenants to retrieve this data for. |
The issue still persists |
Error still happens in 2.68.0 ➜ az version
{
"azure-cli": "2.68.0",
"azure-cli-core": "2.68.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"application-insights": "1.2.2",
"bastion": "1.3.1",
"ssh": "2.0.6",
"subscription": "1.0.0b2"
}
} |
Issue still present PS C:\Git> az version PS C:\Git> az consumption usage list --end-date 2025-01-02 --start-date 2019-01-01 |
Describe the bug
az consumption usage list --start-date 2021-10-01 --end-date 2021-11-01
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 "/home/raimond/.local/lib/python3.8/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 664, in execute
raise ex
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 729, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 711, in _run_job
result = list(result)
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/aaz/_paging.py", line 46, in next
curr_page, self._next_link = self._extract_result()
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
result = list([transform_usage_output(item) for item in result])
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in
result = list([transform_usage_output(item) for item in result])
File "/home/raimond/.local/lib/python3.8/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
Related command
az consumption usage list
Errors
The command failed with an unexpected error. Here is the traceback:
'usageStart'
Traceback (most recent call last):
File "/home/raimond/.local/lib/python3.8/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 664, in execute
raise ex
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 729, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/commands/init.py", line 711, in _run_job
result = list(result)
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/aaz/_paging.py", line 87, in next
return next(self._page_iterator)
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/core/aaz/_paging.py", line 46, in next
curr_page, self._next_link = self._extract_result()
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in _output
result = list([transform_usage_output(item) for item in result])
File "/home/raimond/.local/lib/python3.8/site-packages/azure/cli/command_modules/consumption/custom.py", line 85, in
result = list([transform_usage_output(item) for item in result])
File "/home/raimond/.local/lib/python3.8/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
debug1.txt
Expected behavior
Result from az consumption list
Environment Summary
azure-cli 2.57.0
core 2.57.0
telemetry 1.1.0
Extensions:
account 0.2.5
aks-preview 1.0.0b5
application-insights 1.2.0
costmanagement 0.3.0
rdbms-connect 1.0.4
resource-graph 2.1.0
storage-preview 1.0.0b1
virtual-wan 0.3.0
Dependencies:
msal 1.26.0
azure-mgmt-resource 23.1.0b2
Python location '/usr/bin/python3'
Extensions directory '/home/raimond/.azure/cliextensions'
Python (Linux) 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0]
Your CLI is up-to-date
Additional context
No response
The text was updated successfully, but these errors were encountered: