Nathan
Nathan

Reputation: 1

Azure billing API runs Ok but returns nothing to view?

I'm using the billing-dotnet-usage-api. I have configured it correctly and it connects to Azure, no errors. I get a black cmd window which says:

Calling Usage service...
Usage service response status: OK
Usage stream received. Press ENTER to continue with raw output.

{"value":[]}
Raw output complete. Press ENTER to continue with JSON output.

{"value":[]}
JSON output complete. Press ENTER to close.

When I press enter it closes and goes back to visual studio but I get no data or anything relating to costs/billing/breakdowns.. Nothing?!

Have I missed something..?

Upvotes: 0

Views: 72

Answers (1)

Francois
Francois

Reputation: 893

The API provides your usage data separate from the rates charged, you have to do the work to calculate the charges yourself. Basically you have to retrieve your usage using the Usage API and then the rates for your subscription using the Rates API. Then you have to calculate the charges by joining the usage to the rates on the Meterid GUID.

The example app from the team hosted here contains the code to convert the JSON data to C# objects.

I have a post here that explains how to do the calculations in more detail.

Upvotes: 1

Related Questions