- Print
- DarkLight
- PDF
Application Insights for logging Azure Functions
- Print
- DarkLight
- PDF
When provisioning a Function App, you can add Application Insights with minimal effort. By default, it will create an Application Insight instance belonging to your Function App.
A Function App is a container for one or more functions – the app is tied to either a consumption or App Service Plan, a storage account, and Application Insights instance.
With Application Insights for Azure Functions, you instrument your functions to enable logging. Furthermore, you also instrument your backend components. Consider a function receiving messages through HTTP trigger and pushing these messages into a Cosmos DB collection (document).
When testing or running your functions in production, you can examine the live stream telemetry. Furthermore, you can see the traces and look the information you set using statements from the Ilogger, which Azure Functions natively supports. The statements you provide inside your functions can be found in traces inside Application Insights (see also the screenshot below).