Share via

Azure cost managment API returns wrong value

Lily 6 Reputation points
2022-08-01T08:22:19.527+00:00

Hi,
I am working on getting the daily billing from API, but I noticed that sometimes I get the wrong value.
Here is my correct usage:
226647-6em9difukb0x8ktl.png

And here is what I get sometimes when switching to Group by Meter category

226580-8aimsbj41t36iwut.png

The values are multiplied for some reason.
I tested the API overnight and got the multiplied value 18 times out of 267 between the hours 19:32 and 23:58.
The API I used is:
POST https://management.azure.com/subscriptions/<sub_id>/providers/Microsoft.CostManagement/query?api-version=2021-10-01
with the body:
{"type":"ActualCost","dataSet":{"granularity":"Daily","aggregation":{"totalCost":{"name":"Cost","function":"Sum"}},"sorting":[{"direction":"ascending","name":"UsageDate"}],"grouping":[{"type":"Dimension","name":"MeterCategory"},{"type":"Dimension","name":"PublisherType"},{"type":"Dimension","name":"ChargeType"}]},"timeframe":"Custom","timePeriod":{"from":"2022-07-25T00:00:00+00:00","to":"2022-07-25T23:59:59+00:00"}}

Please advise if this is a normal behavior.
Thank you

Cost Management
Cost Management

A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Sadiqh Ahmed 49,571 Reputation points Microsoft External Staff Moderator
    2022-08-02T03:22:27.16+00:00

    Hello @Lily Sorry for the inconvenience this must have caused!

    Thanks for sharing the screenshots. This looks like “doubling”. We request ids and relevant details to investigate this issue further. Please file a support request with cost-management support team to look into this.

    Here is the link - https://learn.microsoft.com/en-us/azure/azure-portal/supportability/how-to-create-azure-support-request to create support case.

    FYI: Azure Cost Management support is included in the Basic Support Plan without any charge.
    https://azure.microsoft.com/en-us/support/plans/

    ----------------------------------------------------------------------------------------------------------------------

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

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.