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. Open the Getting Started page and open "Monitor and diagnose client side".

    Code snippet for insertion in your web page

Keep the code page open while you do the next step in another browser window. You'll need the code soon.

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

    Customize the system option

  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 Application Insights. While copying make sure to ignore script tags. Refer below screenshot:

    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

    Add the web resource

  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

Sesion 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