Application Insights for logging
  • 11 Sep 2020
  • 1 Minute To Read
  • Contributors
  • Print
  • Comments
  • Share
  • Dark
    Light

Application Insights for logging

  • Print
  • Comments
  • Share
  • Dark
    Light

#ServerlessTips - Azure Functions
Author: Steef-Jan Wiggers Azure MVP

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.
Tip 2 - Use Application Insights for your Functions - Picture 1.png

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, 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).

Application Insights belonging to function will send logging telemetry of both your function and Cosmos DB instance to Application Insights.

Tip 2 - Use Application Insights for your Functions - Picture 2.png

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).
Tip 2 - Use Application Insights for your Functions - Picture 3.png

Always leverage the Application Insights capability, which is seamlessly integrated with Azure Functions. It offers you the Application Insights logging capability and more such as measuring performance, visualize dependencies (Application Map), and analytics.
Was This Article Helpful?