Real Time Telemetry for your Azure Function App using Application Insights

Real Time Telemetry for your Azure Function App using Application Insights

Application Insights helps us to track applications health in real time. You can track your application availability, performance issues, user’s session and diagnose crashes faster than ever. It provides a real-time dashboard for your app to monitor your application. It is fast, very easy to configure and provide very powerful insights for your application. We can capture the real-time telemetry using Application Insights for our Azure Function App as well. There are several ways to do that integration.

Integrate Application Insights While Creating your Azure Function App

 Navigate and Login to your Azure Portal, From New ->  Compute ->  Select Function App, or Search Function App in the Search the marketplace box. Then Create the Function App, by providing all required details including App Name, Subscription Details, Hosting Plan etc. 

To enable the Application Insight, set the last option  “Application Insights“ to ON.

ApplicationInsights

Fig:  Integrate Application Insight while creating Azure Function App

With that, along with creating your Azure Function App, you will have an Application Insight created with mapped with current Azure Function.

Must Read : 5 simple steps to create and test your first Azure Function App

 Using existing Application Insights for Azure Function App

If you have Application Insight already created and you want to integrate it with your Azure Function App, you can do that easily post your Azure Function is created.

Once you Azure Function is created, and you don’ t have configuration done, you will find Configured Features is empty under Overview Tab.

newfunctionappsettings

Fig: Configuration Tab

 

Navigate to “Platform Features” Tab and under General Settings, select “Applications Settings

AppSettingsFig : Application Settings

There along with other settings add a new entry for Application Insights

APPINSIGHTS_INSTRUMENTATIONKEY = <Instrumentation Key>

Follow the Steps to get the Instrumentation Key for an Application Insights: Application Insights Settings –>  Properties –>  Instrumentation Key

instrumentationkey

Fig: Getting Instrumentation Key

Must Read : Getting an Application Insights Instrumentation Key inside Visual Studio itself

Once Application Settings is updated, you may go back again to Overview Tab. Now you will find “Application Insights” is listed under Configured Features. It may take a while to appear in this list.

appinsightadded

Fig: Azure Function App Configuration List

Click on the Application Insights link, it will open the Application Insight Dashboard from where you can start monitoring and review all telemetry data.

AppinsightsForAzureFunction

Fig: Application Insights Dashboard for Azure Function App

Abhijit Jana

Abhijit runs the Daily .NET Tips. He started this site with a vision to have a single knowledge base of .NET tips and tricks and share post that can quickly help any developers . He is a Former Microsoft ASP.NET MVP, CodeProject MVP, Mentor, Speaker, Author, Technology Evangelist and presently working as a .NET Consultant. He blogs at http://abhijitjana.net , you can follow him @AbhijitJana . He is the author of book Kinect for Windows SDK Programming Guide.

3 Comments to “Real Time Telemetry for your Azure Function App using Application Insights”

  1. Abhijit Jana Author

    Thanks for the Feedback. Appreciate it. Regarding your query, I think you can view the Application Insights details inside Visual Studio, irrespective of the services your using it. Which means, While debugging your Azure Function, if you connect the respective App Insights resources , in Visual Studio, you should be able to see the logs as long as your are sending back the telemetry. Are you facing some challenges ? Let me know.

    Thanks.

Comments are closed.