Use Application Insights to find out what users are doing with your app

Application Insights is in preview.

Find out how often users run your app, what environments they run it in, and how many users there are. Insert a few lines of code to find out what features they use, how long they take over different tasks, what mistakes they make, and how often events occur.

Are you using the new Azure version of Application Insights?

How do I know? If you created your project with Visual Studio 2013 Update 3, the telemetry data should be sent to Microsoft Azure. In that case, go here to get started.

This new Microsoft Azure version doesn't have all the features yet. If you still want to use the older version, from the Visual Studio main menu choose Tools->Extensions and Updates and uninstall Application Insights Tools version 2.*. Then install version 1.3.

Add Application Insights to your project

You can add Application Insights to web apps and web services, Windows Store 8.1 apps and Windows Phone 8.0 apps. If you're writing in C++ or you use Visual Studio 2012, follow these more detailed instructions.

  1. Install Application Insights Tools version 1.3 in Visual Studio 2013 (unless you've done that already). 
    In TOOLS, Extension and Updates, in Online, search 'Application Insights'
    Everyone on your team should install the tools.
  2. Add Application Insights to your app.
    If you've already created the app:
    In Solution Explorer, right-click your project and choose Add Application Insights.
    Or if you're creating a new app:
    In the New Project dialog, make sure Add Application Insights is checked.

  3. [Windows Store and Phone apps] Open Configuration Manager.
    In Visual Studio: BUILD, Configuration Manager
    Set your project's build platform to a single platform (not Any CPU).
    Under Platform, choose an option other than Any CPU.

  4. Build and run your app in debug mode (F5) and use it, to generate some data.    

View your data

  1. Open Application Insights. 
    In Solution Explorer, right click the project and choose Open Application Insights Portal
    Your web browser opens on a Dashboard containing a tile like this:
    Raw event stream on your app's dashboard
    You should see events appearing within a few seconds. (If not, see Troubleshooting.)
    If you want to see more details of the events, click the tile to open the Streaming page:
    Events under DIAGNOSTICS. Streaming data.
    The Streaming tile and page are only used while your app is in development. After you build your app in Release mode, you won't see data here.

  2. Data will appear in the USAGE pages after 5-15 minutes. Make sure to select your app, to see the right data.
    Under USAGE, select your application
    If you only see configuration instructions, wait a few minutes more and refresh the page.

  3. Deploy your app.
    As people use your app over the next few hours and days, you'll see charts building up under the Usage tab.
    Go to USAGE and select your project.

Q&A

Q: I'm not seeing any data. What's happening?

A: See Troubleshooting.

Q: How do I find out more about what my users are doing?

A: Insert lines of code to log events and time user actions. Read the details here:

Q: What are the settings in ApplicationInsights.config?

A: See Configuring Application Insights.

Q: Can I use these event logs to help diagnose problems?

A: Not really - the USAGE pages are designed to report aggregate data, not individual events. To diagnose problems, use diagnostic logs and, for a web app, performance monitoring.

Q: What browsers can I use to look at the Application Insights portal?

A: Internet Explorer 10 or later, Safari 4 or later, and the latest two releases of Chrome and Firefox.

Try this next