Granularity level

Skip to first unread message

clément adeline

Nov 23, 2021, 11:57:07 AM11/23/21
to Cloud Carbon Footprint

We are currently testing the tool on our subscriptions in Azure.
We are organized as follow: 
- part of the landscape use "resource group" to segregate environments of each applications.
- an other part of the landscape segregate environments with "subscription" (one azure subscription per env)

Our goal is to be able to evaluate the carbon footprint of each cloud services in each environment. 

So when using the API module, the actual level of granularity is limited to "subscription level" . This does not work with a large part of our landscape.  

Is there a way to change the granularity level to see each "resource group" ? otherwise, that's maybe a feature to be added :)

Thanks a lot for the tremendous work already done !

Cloud Carbon Footprint

Nov 23, 2021, 1:08:39 PM11/23/21
to Cloud Carbon Footprint
Hello Clem,

Thanks for reaching out! Currently, we are using the Azure consumption management API to grab usage data. We may spike into better and more efficient ways.

Per the documentation, it looks like there are URI parameters where you can customize the scope of the API request:

The scope associated with usage details operations. This includes '/subscriptions/{subscriptionId}/' for subscription scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, '/providers/Microsoft.Billing/departments/{departmentId}' for Department scope, '/providers/Microsoft.Billing/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope and '/providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope. For subscription, billing account, department, enrollment account and management group, you can also add billing period to the scope using '/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. For e.g. to specify billing period at department scope use '/providers/Microsoft.Billing/departments/{departmentId}/providers/Microsoft.Billing/billingPeriods/{billingPeriodName}'. Also, Modern Commerce Account scopes are '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for billingAccount scope, '/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for billingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/invoiceSections/{invoiceSectionId}' for invoiceSection scope, and 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/customers/{customerId}' specific for partners.

You can reference further documentation here:

Please let me know if this helps or if you have further questions! If you think a feature could be add to specify different scope, would you be able to submit an issue and we could potentially add it to our project board? We are always looking for contributors to help with these sorts of implementations as well!



clément adeline

Dec 8, 2021, 4:10:08 AM12/8/21
to Cloud Carbon Footprint
Hello Cam,

thank you very much for this answer, and sorry for the delay of the response.
Indeed the Azure consumption API used by carbon footprint allows to retrieve consumption data on customize scope.
In my context, I'll like to use the tool to evaluate the carbon footprint of each service per 'resource group' since a resource group corresponds to an application environment.
The resource group properties is well provided by Azure consumption API ("resourceGroup":)
--> i'll add this to your project board (unfortunately, i have no skill to help you in implementing... but i'll be glad to discuss it further or to know form other users here that i'm not the only one with this need :) )

Thanks again,
Reply all
Reply to author
0 new messages