Forum Discussion

emileer's avatar
emileer
Copper Contributor
Oct 13, 2020

Why does the REST API of Application Insights not support to save searches/queries

Is there a reason why the saving of searches/functions is not supported via REST API in Application Insights (https://dev.applicationinsights.io/documentation/overview).
This is possible in Log Analytics (https://docs.microsoft.com/en-us/rest/api/loganalytics/savedsearches) but not in Application Insights.

6 Replies

  • CloudyRyan's avatar
    CloudyRyan
    Former Employee

    emileer Could you provide some context into what you're looking to do?  You can easily run queries with the API for Application Insights.  If some detail could be provided on the scenario you're trying to address we can help you in creating a solution.

     

           -- Ryan

    • emileer's avatar
      emileer
      Copper Contributor

      CloudyRyan We are using a VSTS delivery pipeline to deploy queries/functions across multiple subscriptions (currently only supported via API by Log Analytics). The saved queries are used by support engineers to quickly identify and visualize problems in the respective environment.
      We would like to have a similar approach for Application Insights. 

       

      • CloudyRyan's avatar
        CloudyRyan
        Former Employee

        emileer Got it -- this helps.  Assuming you're using Workbooks with queries, the best way to do this is not via REST but with an ARM template from my POV.  You can export an existing workbook using the process shown in my screen shot and use, as part of your devops process, an "ARM deployment" task or us PowerShell or the CLI to push this into the subscription/environment with a new App Insights Workspace.  You would need the resource ID of the App Insights workspace as shown in my screenshot.

Resources