none
APIs to access Application Insights RRS feed

  • Question

  • Are there APIs that can be used to access Application Insights? If my scenario is that I don't want to use the SDK but want to call the REST API directly - is there any documentation where I can see what auth mechanism to use for the API and what should go in the header/body etc?

    Thanks!

    Thursday, August 13, 2015 10:08 PM

Answers

  • The API to push data to Application Insights is simply not documented. It is just a standard HTTP post to push data, with a json body in a certain schema. 

    Other teams have used the same approach you are going down. There are 2 tools that may be of help to you. One is that almost all SDKs are open source, so you can look to see how they are constructing and communicating with the API. You can also utilize Fiddler, and a official SDK, to take a look at how the data is formatted. 

    From basic trial and error you should be able to sort out most of the fields. We don't use any authentication, you just need to have your data properly contain the InstrumentationKey. The ApplicationInsights endpoint should respond with useful messages if your data is malformed and rejected. If you are still having trouble, please feel free to contact me at joshweb at microsoft.com. 

    Friday, August 14, 2015 5:22 PM

All replies

  • Thursday, August 13, 2015 10:25 PM
    Moderator
  • Thank you for responding. Is the API not public or just not documented? Because the source for the SDK is open source so I can see how the HTTP request is being formed e.g. here -

    https://github.com/Microsoft/ApplicationInsights-dotnet/blob/master/src/Core/Managed/Shared/Channel/Transmission.cs. Do the APIs only allow access/authentication somehow from the SDK?

    Thanks!

    Friday, August 14, 2015 5:00 PM
  • The API to push data to Application Insights is simply not documented. It is just a standard HTTP post to push data, with a json body in a certain schema. 

    Other teams have used the same approach you are going down. There are 2 tools that may be of help to you. One is that almost all SDKs are open source, so you can look to see how they are constructing and communicating with the API. You can also utilize Fiddler, and a official SDK, to take a look at how the data is formatted. 

    From basic trial and error you should be able to sort out most of the fields. We don't use any authentication, you just need to have your data properly contain the InstrumentationKey. The ApplicationInsights endpoint should respond with useful messages if your data is malformed and rejected. If you are still having trouble, please feel free to contact me at joshweb at microsoft.com. 

    Friday, August 14, 2015 5:22 PM
  • If you are talking about reading data, we don't have the API documented, but we expose AI data as part of the Azure Resource Manager APIs:

    https://msdn.microsoft.com/en-us/library/azure/dn790568.aspx

    If you want to get access to all your data, I would recommend looking into the export feature, which will copy our data into your own storage account and then you can do whatever you want with it. 


    Jakub Oleksy | Developer | Visual Studio Online

    Tuesday, August 18, 2015 9:33 PM
  • Just a heads up that we are working on a REST API to access data from Application Insights now, and still planning some of the final details. If you have thoughts about what you'd like to see, please enter them at http://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/4999529-make-data-accessible-via-apis-for-custom-processin.

    Thanks
    Dale Koetke
    Microsoft

    Tuesday, November 3, 2015 11:16 PM