Search code examples
azure-application-insightsazure-data-explorer

Revert Changes to Kusto Query in MSAI


I recently found out someone accidentally overwrote one of my Kusto queries in Azure Application Insights. Is there a way to revert a query to a previously saved version of it? Or do I really have no other choice but to rewrite the query?

The query is a Legacy Query in the Other Category under Queries in the Azure Logs. I cannot show much more, since this is work related.

enter image description here


Solution

  • After a workaround on your issue, I found that there is no default feature in Azure workspace for reverting a query to a previously saved version of it.

    Below are the few workarounds you can look into.

    1. Under application insights >> logs in the portal, you can be able to view the history of the queries which shows you the query ran in the past.

    enter image description here

    1. Save the query before any conflict or issue happens. Because when you save a query, it will gets automatically stored in a query pack which will not get deleted until you delete it. Refer

    2. Alternatively, you can use restore data management to retrieve the activities done in the past with the help of an API or a CLI command az monitor log-analytics workspace table restore.

    Refer MSDoc for more relevant information.