AZ CLI CONSUMPTION EMTPY RESPONSE WHEN DATA AVAILABLE
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az consumption usage list
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az consumption usage list -s {} -e {} --subscription {} --debug
Expected Behavior
Environment Summary
Linux-5.4.0-1055-azure-x86_64-with-debian-10.2 (Cloud Shell)
Python 3.6.10
Installer: DEB
azure-cli 2.27.0
Extensions:
ai-examples 0.2.5
ssh 0.1.5
Additional Context
I can see there is cost available for current month (Aug) on the Portal (WEB) but when using cli is not getting same info, just getting an emtpy list/array.
When trying same command with July works fine, but with Aug no data comes back.
Empty return az consumption usage list -s 2021-08-01 -e 2021-08-05 --subscription xxxxxxxx
Works just fine az consumption usage list -s 2021-07-01 -e 2021-07-05 --subscription xxxxxxxx
Thanks
@martingianni, could you help run command with --debug as follows to catch debug log for us to further investigation?
az consumption usage list -s 2021-08-01 -e 2021-08-05 --subscription xxxxxxxx --debug
@martingianni, could you help run command with
--debugas follows to catch debug log for us to further investigation?az consumption usage list -s 2021-08-01 -e 2021-08-05 --subscription xxxxxxxx --debug
Here is the output:
az consumption usage list -s 2021-08-01 -e 2021-08-05 --subscription xyz --debug
Command arguments: ['consumption', 'usage', 'list', '-s', '2021-08-01', '-e', '2021-08-05', '--subscription', 'xyz', '--debug']
Event: Cli.PreExecute []
Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x03E0C978>, <function OutputProducer.on_global_arguments at 0x03E9ADF8>, <function CLIQuery.on_global_arguments at 0x03EC0DF8>]
Event: CommandInvoker.OnPreCommandTableCreate []
Modules found from index for 'consumption': ['azure.cli.command_modules.consumption']
Loading command modules:
Name Load Time Groups Commands
consumption 0.019 8 9
Total (1) 0.019 8 9
These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_ai_did_you_mean_this']
Loading extensions:
Name Load Time Groups Commands Directory
Total (0) 0.000 0 0
Loaded 8 groups, 9 commands.
Found a match in the command table.
Raw command : consumption usage list
Command table: consumption usage list
Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x040F4978>]
az_command_data_logger : command args: consumption usage list -s {} -e {} --subscription {} --debug
metadata file logging enabled - writing logs to 'C:\Users\xyz.azure\commands'.
Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
Just to add here on the Azure Portal also its looks strange.. it shows 55 USD in 7 days.. no breakdown available, no cost by service showing neither, tried two accounts, same issue. Guessing it maybe something wrong with the backend where the cost data is saved or the api fetching the data.. just my 2 cents.
Seems it's the issue related to backend service as you can see the response body from service is empty, so route to service team
msrest.http_logger : Response content:
msrest.http_logger : {"value":[]}
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ccmbpxpcrew.
Issue Details
This is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az consumption usage list
Errors:
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
- Put any pre-requisite steps here...
az consumption usage list -s {} -e {} --subscription {} --debug
Expected Behavior
Environment Summary
Linux-5.4.0-1055-azure-x86_64-with-debian-10.2 (Cloud Shell)
Python 3.6.10
Installer: DEB
azure-cli 2.27.0
Extensions:
ai-examples 0.2.5
ssh 0.1.5
Additional Context
| Author: | martingianni |
|---|---|
| Assignees: | - |
| Labels: |
|
| Milestone: | Aug 2021 (2021-09-07) |
@jsntcy
Same issue. However, instead of using:
az consumption usage list
I'm using PowerShell's (PSVersion 7.1.4) Invoke-RestMethod with $uri:
'https://management.azure.com/subscriptions/xxxx-xxxxx-xxxxx-xxxx/providers/Microsoft.Consumption/usageDetails?startDate=2021-06-01&endDate=2021-06-10&$top=5&api-version=2019-10-01
Same result. No Payload:
with 0-byte payload
VERBOSE: received 12-byte response of content type application/json
VERBOSE: Content encoding: utf-8
value : {}
This process works for other subscriptions of the same offer-type, same security roles, same access token, same powershell $env's. A few subscriptions return 0 records though they clearly have billing details in the portal for the period noted.
No $Error[0] is thrown.
@Evogelpohl, for PowerShell issue, please report issue in https://github.com/Azure/azure-powershell which is owned by other team.
@Evogelpohl, for PowerShell issue, please report issue in https://github.com/Azure/azure-powershell which is owned by other team.
It isn't a PowerShell issue. It's a billing-service issue. Any program that can call a REST endpoint - az (python), invoke-restmethod (powershell/.net), Postman - all return the same empty value {} for me on 4 of the 20 subscriptions I'm pulling consumption details.
I've opened a ticket for one of those 4 subs. Awaiting feedback.
I was reenforcing the fact that this bug is repo'able by other REST clients, beyond the Az CLI.
Hope that helps. Thanks!