I am trying to retrieve the cost details of my Azure subscription using either the Azure SDK or the REST API for Azure Cost Management. I have followed the official documentation, but I am encountering issues or unexpected behavior while making API calls.

Suresh Bevara 0 Reputation points
2025-01-31T05:55:51.17+00:00

I am trying to retrieve the cost details of my Azure subscription using either the Azure SDK or the REST API for Azure Cost Management. I have followed the official documentation, but I am encountering issues or unexpected behavior while making API calls.

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,171 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Pranay Reddy Madireddy 2,830 Reputation points Microsoft External Staff
    2025-01-31T16:01:27.7966667+00:00

    Hi Suresh Bevara

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    This API gives you detailed, unfiltered cost data from your Azure bill. It's helpful for smaller datasets and lets you see usage details for each individual meter.
    https://learn.microsoft.com/en-us/azure/cost-management-billing/costs/manage-automation

    The Query API lets you analyze cost data in different ways, so you can filter and group costs by various factors.
    https://learn.microsoft.com/en-us/rest/api/cost-management/

    This API generates detailed cost reports and lets you filter the data on your own after getting information for all resources in your subscription.
    https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report/create-operation?view=rest-cost-management-2024-08-01&tabs=HTTP

    For larger datasets or recurring reports, set up the Exports API to automatically export your cost details to Azure Storage in CSV format on a scheduled basis.

    If you have any further queries, do let us know.


    If the answer is helpful, please and "Upvote it".

    0 comments No comments

Your answer

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