Want to trigger Azure Logic Apps and Power Automate flows based on carbon emissions data? The Carbon AppInsights project has been released on GitHub! This project allows you to query the Carbon emissions data from the ElectricityMaps.com API and add it to an Azure Application Insights instance backed by a Log Analytics workspace. You can then use the metrics sent to Application Insights to trigger actions in Azure Logic Apps and Power Automate flows.
This enables you to do all kinds of things with the standard functionality of these platforms. For example, you can trigger a Logic App to start a VM or trigger a Data Factory pipeline to start a data transfer when the carbon emissions of a region drop below a certain threshold. You can also use the data to trigger alerts in Azure Monitor.
Resources
The deployment of the Carbon AppInsights project consists of the following Azure resources:
- An Azure Application Insights instance
- A Log Analytics workspace
- An Azure Function App with a Timer trigger
- A Storage Account for the Function App
- A Key Vault to store the Electricity Maps API key
The Azure Function App is triggered every 20 minutes and queries the Electricity Maps API with the PSElectricityMaps module.
Getting Started
To get started, you can deploy the Carbon AppInsights project to your Azure subscription by forking the GitHub repository and following the instructions in the README.md file.