Walkthrough: Enabling Telemetry for Microsoft Dynamics CRM Online using Application Insights

This article shows you how to get telemetry data from Microsoft Dynamics CRM Online using Azure Application Insights. We’ll walk through the complete process of adding Application Insights script to your application, capturing data, and data visualization.

Add Application Insights to new or existing CRM Online instance

To monitor your application, you add an Application Insights SDK to your application. The SDK sends telemetry to the Application Insights portal, where you can use our powerful analysis and diagnostic tools, or export the data to storage.

Create an Application Insights resource in Azure

  1. Get an account in Microsoft Azure.

  2. Sign into the Azure portal and add a new Application Insights resource. This is where your data will be processed and displayed.

    Click +, Developer Services, Application Insights.

    Choose ASP.NET as the application type.

  3. Follow the instructions to get the JavaScript SDK script for your app, copy the JavaScript snippet and make sure to replace the Instrumentation Key with the correct value for your Application Insights resource.

Create a JavaScript web resource in Microsoft Dynamics CRM

  1. Open your CRM Online instance and login with administrator privileges.

  2. Open Microsoft Dynamics CRM Settings, Customizations, Customize the System

    Microsoft Dynamics CRM settings

    Settings > Customizations

  3. Create a JavaScript resource.

    New Web Resource dialog

    Give it a name, select Script (JScript) and open the text editor.

    Open the text editor

  4. Copy the code from the Application Insights JavaScript SDK in which you configured your Instrumentation Key before. While copying, make sure to ignore script tags. Refer to the screenshot below:

    Set your instrumentation key

    The code includes the instrumentation key that identifies your Application insights resource.

  5. Save and publish.

    Save and publish

Instrument Forms

  1. In Microsoft CRM Online, open the Account form

    Account form

  2. Open the form Properties

    Form properties

  3. Add the JavaScript web resource that you created

    Add menu

  4. Save and publish your form customizations.

Metrics captured

You have now set up telemetry capture for the form. Whenever it is used, data will be sent to your Application Insights resource.

Here are samples of the data that you'll see.

Application health

Example page load time

Example page views chart

Browser exceptions:

Browser exceptions chart

Click the chart to get more detail:

Exceptions list


Users, sessions and page views

Session charts

Browser versions


Breakdown of page load time

Count of sessions by browser version


Session count by country

Sessions and users by country

Inside page view request

Page view summary

Search on page view events

Similar page views

Page view properties

Pages per session

Sample code

Browse the sample code.

Power BI

You can do even deeper analysis if you export the data to Microsoft Power BI.

Sample Microsoft Dynamics CRM Solution

Here is the sample solution implemented in Microsoft Dynamics CRM.

Learn more