1

I have logged data in Application Insights traces table which I want to change/modify using an API. Is there a way to do this, similar to the purge operation?

  • no, you cannot. You can only change them before send to app insights. And you can also use Kusto query to generate a temp modified table. – Ivan Glasenberg Apr 22 '20 at 06:33
  • @IvanYang, thank you for your reply. Is there any other table in App insights that we can use where we can modify stored data or is entire app insights read-only? What about writing additional data in a row if not modifying existing data? – Garv Sharma Apr 22 '20 at 06:54
  • The entire app insights is read-only:(. And why you need to change these data? – Ivan Glasenberg Apr 22 '20 at 07:00
  • We are storing some tag data in the table from a web application (automatically generated) in the traces table. Now admin wants to manually change that tag data to annotate for review purposes. Now it seems we'll have to move all the logging & data to a separate DB. – Garv Sharma Apr 22 '20 at 07:24
  • can you just use Kusto query to extend a new column with the new value? – Ivan Glasenberg Apr 22 '20 at 07:56
  • I can use this approach. Do you know if there is an API to write data to the existing row as there are other values too? – Garv Sharma Apr 22 '20 at 08:06
  • sorry, since the data in app insights is read-only, we cannot do such write operation. – Ivan Glasenberg Apr 22 '20 at 08:07
  • Hmm, so I will have to maintain a separate column to store the new data and check back each time in future if there is a change recorded. – Garv Sharma Apr 22 '20 at 08:09
  • @IvanYang you should enter your comments here as the answer and get your internet points, because you are correct, the appinsights/loganalytics databases are effectively read only aside from purge operations. – John Gardner Apr 22 '20 at 18:58
  • @GarvSharma, this is by design. I added an answer to close it. Please help accept it as answer as per [this link](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work?answertab=active#tab-top) so it would help others. Thanks. – Ivan Glasenberg Apr 23 '20 at 00:59

1 Answers1

2

The data exists in application insights is read-only(except for the purge operations), so you cannot modify it or add a new column to it.

If you want to modify it, as you already mentioned, move all the logging & data to a separate DB which supports the update operation.

Ivan Glasenberg
  • 29,865
  • 2
  • 44
  • 60
  • This should be the accepted answer. Which is a problem for us as we had a bug and all our apps have one column with garbage and we would be able to fix it if the table was editable. – Ignacio Soler Garcia Aug 23 '22 at 12:10