Integrate Azure carbon emission data into carbon cost reporting #2773
Labels
E2
Estimated level of Effort (1 is easiest, 4 is hardest)
needs-follow-up
opencost
OpenCost issues vs. external/downstream
P2
Estimated Priority (P0 is highest, P4 is lowest)
Is your feature request related to a problem? Please describe.
Azure customers should have the ability to view OpenCost's carbon cost reporting based on the same data that is provided by the Carbon optimization dashboards available within the Azure portal. Having data that aligns with what Azure is reporting but sliced down to Kubernetes-centric resources will be a good compliment to the Azure resource-centric emission reports.
Describe the solution you'd like
Azure carbon optimization provides APIs and exports to enable users to track and analyze Scope 1, 2, and 3 emissions associated with Azure down to the resource level.
Can the carbon cost functionality of OpenCost be updated to allow Azure customers to invoke the Carbon optimization REST API to get data on-demand or provide their own CSV file?
The API call will require an Azure Bearer token but it should be easy to obtain using the same service principal that is used to get Azure cost reporting data (as long as proper RBAC is assigned. See this doc for more on access permissions)
Describe alternatives you've considered
Leave current implementation as is which uses carbonlookupdata.csv as basis for report.
Additional context
You can test the Carbon optimization API in your subscription with the following Azure CLI commands:
The emissions data is available for the previous month by the 17th day of the current month and contains JSON payload that looks like this:
Request payloads for other reports can be found here: https://learn.microsoft.com/azure/carbon-optimization/export-data?tabs=RESTAPI
The text was updated successfully, but these errors were encountered: