Azure / azure-cli

Azure Command-Line Interface
MIT License
3.98k stars 2.96k forks source link

`az costmanagement export`: what is the scope of a billing profile? #29673

Open roy-work opened 1 month ago

roy-work commented 1 month ago

Describe the bug

All of the documentation (e.g., here) as well as the CLI az costmanagement itself, lacks any documentation about how to specify a billing profile as a scope for creating/listing/etc. billing exports.

E.g., the docs document, subs, management groups, and even resource groups… but not a billing profile.

Related command

az costmanagement export list --scope ???

I've tried using the "id" of a billing profile, i.e., /providers/Microsoft.Billing/billingAccounts/$acct_id/billingProfiles/$profile_id, but that doesn't seem to work. (It doesn't error, but it doesn't seem to work; I have an export under that profile, but the command returns [].)

Errors

N/A

Issue script & Debug output

az costmanagement export list --scope

Expected behavior

To be able to supply a billing profile to the commands under az costmanagement export.

Environment Summary

» az --version
azure-cli                         2.59.0 *

core                              2.59.0 *
telemetry                          1.1.0

Extensions:
automation                       1.0.0b1
costmanagement                     0.3.0
databricks                        0.10.2
ssh                                2.0.3

Dependencies:
msal                              1.27.0
azure-mgmt-resource             23.1.0b2

Python location '/usr/local/Cellar/azure-cli/2.59.0/libexec/bin/python'
Extensions directory '/Users/roy/.azure/cliextensions'

Python (Darwin) 3.11.8 (main, Feb  6 2024, 21:21:21) [Clang 15.0.0 (clang-1500.1.0.2.5)]

Legal docs and information: aka.ms/AzureCliLegal

You have 2 update(s) available. Consider updating your CLI installation with 'az upgrade'

Additional context

:face_exhaling: Exporting the bill — the entire bill — seems like the use case. Like, the first, and the biggest, use case. A billing profile is, AFAICT, the object that corresponds to that.

(Perhaps the right management group might, too, if you have everything under one. But my security team is also loathe to grant privs to things above subs/tenants in that hierarchy. But the separate billing hierarchy is easier to request access to.)

(I ended up creating the export via the Portal UI, though even there I'm not able to get it to export to the storage account I want, which is in a different subscription than the subscription with the billing profile.)

azure-client-tools-bot-prd[bot] commented 1 month ago

Hi @roy-work,

2.59.0 is not the latest Azure CLI(2.63.0).

If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.

yonzhan commented 1 month ago

Thank you for opening this issue, we will look into it.

microsoft-github-policy-service[bot] commented 1 month ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @ms-premp, @ramaganesan-rg.