简体   繁体   中英

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..? Thanks

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM