Deploy Application Insights globally on modern SharePoint
On my last article I’ve provided a solution to deploy Application Insights to classic SharePoint without modifying the master page and on todays article I’m providing the same solution but for modern SharePoint using an Application Customizer and Tenant Wide Deployment.
Setup Application Insights
Before installing Application Insights on SharePoint, you first need to do the setup on your Azure account following the steps below.
- Sign In on the Azure Portal
- On the left bar click on Create Resource
- Search for Application Insights
- Click on Create
- Provide a name for the application
- Select ASP.NET web application on the Application Type
- Create a new Resource Group and provide a name
- Select your data center Location
- Once created click on overview tab
- Copy the Instrumentation Key and save it for later
How to use Application Insights on modern SharePoint
This solution can be installed and configured directly through the browser, to do it follow the steps below:
- Download and Extract the solution from here
- Open your tenant app catalog
- Click on Apps for SharePoint
- Upload the solution to the catalog
- Check the option Make this solution available to all sites in the organization
- Go to Site Contents
- Open the list Tenant Wide Extensions
- Edit the ModernApplicationInsighs item
- Modify the Component Properties and replace the keyvalue by your Application Insights tracking ID.
- Save the item and all your modern SharePoint site on Office 365 are ready to be monitored. If this was the first solution globally deployed on your tenant, it may take up to 20 minutes get available.
With the modern and classic version of the solution to add Application Insights to SharePoint you will be able to monitor the use of your Intranet without sending your data outside the Microsoft ecosystem.
As always, the source code for this solution is available on GitHub, feel free to use and modify it according to your needs.