Rules

Secret ingredients to quality software

Edit
Info

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

Last updated by Tiago Araújo [SSW] on 18 Mar 2021 06:08 pm (about 2 months 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:

William YinWilliam Yin
Chris BriggsChris Briggs

We open source. This page is on GitHub