Consumption list API returns unexpected service period date

y-watanabe 1 Reputation point
2022-12-28T02:30:45.46+00:00

I've asked in stack overflow but couldn't get any help so I would also like to ask in this community .

I am using python sdk to consume billing information , however, I am getting invalid service_period_start_date and service_period_end_date .
This was not happening in our environment before Nov 14, 2023 .

   "servicePeriodEndDate": "0001-01-01T00:00:00Z",  
   "servicePeriodStartDate": "0001-01-01T00:00:00Z",  

In what situations does Consumption API return such date ? Any help is appreciated !

Thanks,
Yu

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,606 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SadiqhAhmed-MSFT 49,326 Reputation points Microsoft Employee Moderator
    2022-12-28T07:43:30.847+00:00

    Hello @y-watanabe Thank you for contacting us!

    The call by Billing Account Balances - Get By Billing Account - REST API (Azure Consumption) | Microsoft Learn gives current month data only.

    To get data for other billing periods, please use this API Balances - Get For Billing Period By Billing Account - REST API (Azure Consumption) | Microsoft Learn
    Also, try using the Cost Details API: https://learn.microsoft.com/en-us/rest/api/cost-management/generate-cost-details-report see if that yields results. Hope this helps!
    ----------------------------------------------------------------------------------------------------------------------

    If the response helped, do "Accept Answer" and up-vote it

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.