2

I came to know that Azure recently released their billing and usage API. I am aware of Azure's Java SDK, but did not find classes which will give me usage and billing data in the SDK docs. However, is there a Java SDK released for the same or should I write my own HTTP client queries to get data using these API's?

jobin
  • 2,600
  • 7
  • 32
  • 59

2 Answers2

3

I am not aware of any Billing and Usage SDK for .net or Java. I think there is only the following options:

Azure Usage API – A REST API that customers and partners can use to get their usage data for an Azure subscription.

Azure RateCard API – A REST API that customers and partners can use to get the list of the available resources they can use, along with metadata and price information about them.

http://weblogs.asp.net/scottgu/new-azure-billing-apis-available

https://msdn.microsoft.com/en-us/library/azure/mt218998.aspx

So yes, you would have to make your own HTTP client requests.

  • 1
    There sure isn't any SDK as of now, and I confirmed this with one of Microsoft's developers. Thanks :) – jobin Aug 22 '15 at 09:19
3

You could use these REST APIs through your own HTTP client requests like the other Azure REST APIs. But the Billing REST APIs need to authenticate Azure Resource Manager requests, refer to https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx#bk_portal and follow the steps of "Set up authentication using the Management Portal". Also, we can finish authentication with Java ADAL SDK, please refer to this document:https://github.com/AzureAD/azure-activedirectory-library-for-java

There is a code dotNET sample project "BillingCodeSamples" on GitHub(https://github.com/Azure/BillingCodeSamples). You can refer to the samples to make your Java project.

Best Regards.

Peter Pan
  • 23,476
  • 4
  • 25
  • 43
  • There sure isn't any SDK available as of now for billing and usage; the main Azure Java SDK doesn't support billing and usage. – jobin Aug 22 '15 at 09:20