Azure - Getting data for the past X months

105 views
Skip to first unread message

Georges Legros

unread,
Nov 10, 2023, 6:19:21 AM11/10/23
to Cloud Carbon Footprint
Hello,
I just discovered this cool product and I'm trying to integrate for our Azure consumption.
I modified the .env file with the following dates:

REACT_APP_START_DATE=01-01-2022
REACT_APP_END_DATE=11-01-2023

I would like to get the data for the entire year 2022 and all the way to this month.

The console show this at runtime:
[1] 2023-11-10T10:46:53.468Z [AzureAccount] info: Getting data for MySubscription...
[1] 2023-11-10T10:46:53.470Z [ConsumptionManagement]
info: Getting consumption usage details from 2022-01-01T00:00:00.000Z to 2023-11-01T23:59:59.999Z


So the dates seem to be fine.
Now the result is kind of disappointing as I only get data for the current month:
Screenshot 2023-11-10 121334.png

Is this by design or did I made a mistake in the configuration?
For information I gave the following Role Assignments to the app registration (found on another conversation here):

- Billing Reader
- Cost Management Reader

I was also wondering if there could be some extra configuration that are necessary in Azure.

Thanks a lot.



Cloud Carbon Footprint

unread,
Nov 30, 2023, 12:43:55 PM11/30/23
to Cloud Carbon Footprint
Hi,

Sorry for the late follow-up on this! Would you be able to provide some additional details regarding your configuration such as the value you have set for the GroupBy parameter? An easier way to do this would probably be to open up the network tab in your browser's Dev Tools and screenshot an example of the requests made to the /api/footprint/ endpoint that the client is sending.

It is also possible that depending on the setup for your Azure account that the history of your billing data has not been back-filled prior to your request, which may require some correspondence with Azure Customer Support in order to make that data available.

Thanks,
The CCF Team at Thoughtworks

Georges Legros

unread,
Dec 1, 2023, 10:26:55 AM12/1/23
to Cloud Carbon Footprint
Hello,

Thanks for the follow-up.
I'm going to guess that this is what you are looking for:
  1. start:
    2022-01-01
  2. end:
    2023-11-01
  3. ignoreCache:
    true
  4. groupBy:
    day
  5. limit:
    50000
  6. skip:
    0

I grabbed that from the network call.
Anyway, while waiting for your response, I did not use the tool anymore and now, it shows no data at all and the subscriptions are not available in the drop down anymore... that's weird but I guess that it's because Azure does not return anything and therefore, there is no point filtering on anything.

So I suppose there is something to ask to the azure support. Can you help me formulate the request?

Thanks,

Georges Legros

unread,
Dec 1, 2023, 10:27:12 AM12/1/23
to Cloud Carbon Footprint
Hello,

Thanks for the follow-up.
For some reason, it seems that my previous message did not get posted.. weird...

Anyway, here is what I got from the network tab:

  1. start:
    2022-01-01
  2. end:
    2023-11-01
  3. ignoreCache:
    true
  4. groupBy:
    day
  5. limit:
    50000
  6. skip:
    0

So the grouping is by Day.

Now could I ask you to give a bit of guidance for the request to Microsoft?

However, I think part of the problem is because of the fact that our company has a parent company that handles the billing part.
What I did was to create the app service registration and giving access to the subscriptions from my end but the billing is on the other end. I should ask the parent company to provide the app registration.
Does that make sense?

Thanks a lot!







On Thursday, November 30, 2023 at 6:43:55 PM UTC+1 Cloud Carbon Footprint wrote:

Nikhil Khedkar

unread,
Dec 12, 2023, 9:29:35 AM12/12/23
to Cloud Carbon Footprint
Were you able to get this to working?

Georges Legros

unread,
Dec 12, 2023, 9:39:25 AM12/12/23
to Cloud Carbon Footprint
Not yet actually. Still waiting for our "parent company" to provide access.
However, if you see something else that I could try, shoot :D

Thanks,

Cloud Carbon Footprint

unread,
Jan 26, 2024, 12:55:39 PMJan 26
to Cloud Carbon Footprint
Hello,

Sorry for the late follow-up. We wanted to check in and see if you were able to make any progress. 

If not, we wanted to provide an update that this issue may be caused due to the type of Enterprise subscription that you may have. The latest version of the Azure Usage Details API that we use only supports Enterprise Agreement accounts when returning historical data. For modern enterprise accounts, or Microsoft Customer Agreements (MCA), it will default to the current month. To further explain why this is the case, you can refer to this Github issue that we addressed on this topic and our plans to migrate to the new API in order to fix this issue. The TLDR is that they use two different endpoints for each account type behind the scenes and the SDK does not expose the proper parameters to allow us to pass along the appropriate date ranges for MCA accounts.

We hope to have a fix for this soon as mentioned in the steps listed in the Github Issue.

Best,
The Cloud Carbon Footprint team at Thoughtworks

Georges Legros

unread,
Jan 26, 2024, 1:36:55 PMJan 26
to Cloud Carbon Footprint
Hello,

Thanks a lot for coming back to me and specifically for the perfect timing! This topic went underground for a few weeks on our side and just go reopened yesterday and I can confirm that I indeed get data for the current month.
So I'm going to jump on that link and investigate further to grab the workaround so we can get this resolved.
I'll report back in a few days as soon as I get some extra time to work on it.

Have a nice weekend!

--
We're excited to hear from you and hope you're enjoying Cloud Carbon Footprint.
Please fill out our feedback form: https://forms.gle/nFzkRioryy4R1DGB6
Add your name to ADOPTERS.md: https://github.com/cloud-carbon-footprint/cloud-carbon-footprint/blob/trunk/ADOPTERS.md
Give us a star on the github if you're enjoying the tool!
---
You received this message because you are subscribed to a topic in the Google Groups "Cloud Carbon Footprint" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cloud-carbon-footprint/-6V2xcQE-K8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cloud-carbon-foot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-carbon-footprint/0b4e186c-9b4c-46ec-a66e-f2190918dd78n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages