Azure / Azure/azure-cli

"az consumption" is almost worthless because of how long it takes to execute

Open
#23,204 2 comments 1 reaction 0 assignees View on GitHub
act-codegen-extensibility-squad Auto-Assign consumption customer-reported Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**

az consumption usage list

**Describe the bug**

The command takes a RIDICULOUSLY long time to complete. Combined with essentially zero parallelization (which I'll file another issue on after this one) it takes longer than a day to get cost data for our tenant. This means I can't run daily reports on cost, which is simply absurd.

**To Reproduce**

`az consumption usage list -a -m -s 2021-06-01 -e 2022-06-30 --subscription 368cd81b-e87b-4529-be1e-xxxxxxxxxxxx`

**Expected behavior**

The command should return within a reasonable time frame - say... a minute or two. The web UI, which has the costs sliced and diced, actually loads pretty quickly.

The above az-cli command took over 36 minutes to complete.

**Environment summary**

Installed via `brew` on a macbook and iMac, currently running MacOS 10.16 and/or 10.15.7, but this has been slow for literally the last few years no matter what the OS or az-cli versions. Here's the macbook version:

`az version
{
"azure-cli": "2.23.0",
"azure-cli-core": "2.23.0",
"azure-cli-telemetry": "1.0.6",
"extensions": {
"azure-devops": "0.18.0",
"databricks": "0.7.2",
"kusto": "0.2.0",
"log-analytics-solution": "0.1.1",
"resource-graph": "1.1.0",
"storage-preview": "0.7.2"
}
}`

**Additional context**

The `consumption` subcommand has been in preview for years. Come on.

"WARNING: Command group 'consumption' is in preview and under development."

I've the full debug log of a sample run, 708M of `--debug`, which I can pass along if you want (I can point to a URI or whatever, if you mail me.)

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.