1

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?

Aman Sharma
  • 1,930
  • 1
  • 17
  • 31

2 Answers2

2

I believe the documentation is pretty explicit about this.

The request URL to fetch the data is:

_https://management.azure.com/subscriptions/{subscription-Id}/providers/Microsoft.Commerce/UsageAggregates?api-version={api-version}&reportedStartTime={dateTimeOffset-value}&reportedEndTime={dateTimeOffset-value}&aggregationGranularity={granularity-value}&showDetails={showdetail-boolean-Value}&continuationToken={token-value}

Which means when fetching the data, you should use Reported Date/Time.

Here's the response body you get:

{
    "value": [
        {
            "id": "/subscriptions/f68815e6-3c41-45ef-bbd8-5f83303c396b/providers/Microsoft.Commerce/UsageAggregates/Daily_BRSDF_20140501_0000",
            "name": "Daily_BRSDF_20140501_0000",
            "type": "Microsoft.Commerce/UsageAggregate",
            "properties": {
                "subscriptionId": "f68815e6-3c41-45ef-bbd8-5f83303c396b",
                "usageStartTime": "2015-03-03T00:00:00+00:00",
                "usageEndTime": "2015-03-04T00:00:00+00:00",
                "meterName": "Standard IO – Page Blob/Disk (GB)",
                "meterCategory": "Storage",
                "meterSubCategory": "Geo Redundant",
                "unit": "GB",
                "meterId": "0e9d0c9b-ab6d-4312-9c7e-3794e22af9c4",
                "infoFields": {
                },
                "quantity": 0.057865
            }
        },
…

Which returns you usage dates.

One thing that you need to realize is that there're some delays as to when the data is reported. So usage data for 8th could be reported on 8th, 9th, 10th or even later. Please read the Frequently Asked Questions to understand more about these dates.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • I am not talking about how to fetch the usage data. What you explained is the question itself. I am asking **after** I have the usage and ratecard data, which date should I use to **calculate and generate the bill**. It should be usage date as per FAQs but from my observation, it seems that Azure team themselves also use the Reported date while calculating the bill at the end of the month. This is not documented anywhere. I just need a confirmation on this. – Aman Sharma Apr 12 '16 at 16:18
  • Usage data doesn't even contain reported date/time. I'm not sure how you'll calculate the bill based on the data that you don't have. – Gaurav Mantri Apr 12 '16 at 16:37
  • You already have the reported date when you are calling the API to get the data. So it is not in the data provided by the API. I add the Reported date/time to the usage data before saving it to the database. As per FAQs on the official site, the reported date for any usage data does not change. So we can safely record the reported date/time with the usage data we get for that date. – Aman Sharma Apr 12 '16 at 18:15
2

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.