Do you know how to set up Application Insights (in SharePoint)?

Last updated by Tiago Araújo [SSW] about 3 years ago.See history

The best approach of setting up Application Insights in SharePoint is a bit different than adding to normal web application.

Note: To check the normal way of setting up Application Insights via Visual Studio, please read "How to set up Application Insights"

With a web application you are developing you have full control of web.config and have access to it in your Visual Studio project, and can follow "How to set up Application Insights" to set up Application Insights. This way Visual Studio will do all the modifications for you automatically.

But when you develop on SharePoint, you do not have a full copy of web.config in your Visual Studio project, the web.config will be initialized on the SharePoint server when a new SharePoint site is created. This means Visual Studio cannot be used to update the web.config for you. Although you can modify SharePoint web.config via coding, that involves lots of development and testing work against your SharePoint server.

The best process to implement Applications Insights in SharePoint can be split into two parts:

  1. Implement App Insight JavaScript in master page (via Visual Studio)  or web pages individually via embedded code, there are two good articles include the detail steps:
  2. https://docs.microsoft.com/en-us/azure/azure-monitor/app/sharepoint
  3. https://azure.microsoft.com/en-us/blog/understand-your-sharepoint-usage-with-application-insights-2/
  4. Use Application Insights Status Monitor configuration tool to add DLLs reference and update web.config (no coding work involved), there are two articles include the detail steps:

We open source. Powered by GitHub