Search code examples
azurerestazure-application-insights

Application Insights REST API difference between 'get' and 'execute'


I want to query data from Azure Application Insights. In Azure REST Api reference, they have two operations:

  1. execute
  2. get

The problem is that they both "Execute an Analytics query". What's the difference between them and what should one use?


Solution

  • The only difference is that to execute a query you need to do a POST with the query details in the body whereas getting a query result you need a GET with the query details in the url parameters.

    Which one to use is a matter of preference. If you don't want executed queries in your logs you might prefer the POST since the query text is not a url parameter.