Search code examples
azureazure-billing-api

Which Date to use while generating Azure Bill programmatically using Billing APIs


There are two types of times with the Chargeback reporting data:

  1. Processing Date: Also known as Reported date. It is the Date on which the data is reported in the Azure system.
  2. Usage Start and End Date: This is the actual date when the resource was used in Azure.

E.g. You create a VM in Azure and it was up and running for 5 hours on 8th of April until midnight. Now only 2 of those hours are reported on 8th in Azure. And the remaining 3 hours are reported on 9th of April. So in this case:

  • For first 2 hours, the Processing or Reporting date is 8th April. And the usage date is also 8th April.
  • For the remaining 3 hours: the Processing or Reporting date is 9th April. But the usage date is still 8th April as the actual usage of those hours happened on 8th April.

Now when generating the bill there is no documentation which dates to use. I have three options and their combinations:

  1. Processing or Reported Date
  2. Usage Start Date
  3. Usage End Date

Theoretically, it makes sense to generate the bill using Usage dates. But when I pull the actual bill from https://account.windowsazure.com manually and compare the same to the one generated via APIs, it seems that the bill is being generated in Azure by Reported Date instead.

Ask: Can you please check and confirm that I should be using the Reported Date while generating the billing reports?


Solution

  • I believe you can use Reported Date for generating the bill too. Afaik Microsoft billing generated is also based on the Reporting Date. I also tested this in my subscription for multiple months vs the data from billing API and found this to be true.