question

AayushiSolanki-8981 avatar image
0 Votes"
AayushiSolanki-8981 asked SadiqhAhmed-MSFT commented

How to fetch management group cost by using Azure cost management API?

Instead of fetching subscription data, I want to fetch the data at management group, what would be the endpoint for it, also parameter.
And also for this any oauth profile is required or not?

azure-cost-management
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AayushiSolanki-8981 Thank you for contacting us!

From the description I get that you want to fetch cost management data at management group level.

Need few details:

Which API are you calling? or what type of data are you looking for? Is it detailed charge information? A summary of charges?

Also what channel are you asking about?

0 Votes 0 ·

Like we use cost management API to fetch the cost incurred within the subscription. For that I use this API
{ https://management.azure.com/{scope}/providers/Microsoft.CostManagement/query?api-version=2021-10-01 }, along with required parameters.

Similarly, I need to fetch management level cost incurred by the resources within a management group.
How do I achieve this.

0 Votes 0 ·

Thanks

0 Votes 0 ·
Show more comments

1 Answer

SadiqhAhmed-MSFT avatar image
1 Vote"
SadiqhAhmed-MSFT answered SadiqhAhmed-MSFT edited

@AayushiSolanki-8981 Query API supports management groups as a scope as well. However, we do not support management groups that contain MCA subscriptions.

Refer to the documentation below:

Management group scope parameters are documented here - https://docs.microsoft.com/en-us/rest/api/cost-management/query/usage#uri-parameters

Management group query sample request - https://docs.microsoft.com/en-us/rest/api/cost-management/query/usage#managementgroupquery-legacy

Hope this helps!



If the response helped, do "Accept Answer" and up-vote it

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.