Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure function log that is older than 20 days

I'm trying to look at the logs for my Azure function, In the Monitor view, I can just click the link under the Date column for the logs for a certain run. But this is only for the last 20 invocation. For the older log how can I get it?

log 1

After clicking the Run query in Application Insight link above, I arrived to a page with a table with the log entry, but I don't know how to open the actual logs!

application insight

like image 738
freshWoWer Avatar asked Sep 13 '25 05:09

freshWoWer


1 Answers

If you want to access to the logs of an execution of your function app prior to those top twenty and you don't know so much how to query in Application Insights. There is an alternative using pre made queries available at monitor tab of your function.

  1. Go to "Run query in application insights" to find the specific execution you are looking for. List item This will auto generate for you the same query that filled the above grid. Here you just need to change the timestamp where condition to match our needs. For example a specific date and time range: enter image description here "where timestamp between (todatetime('2022-10-01T00:00:00Z')..todatetime('2022-10-01T23:59:59Z'))" With this change just run the query and identify function run you want to get full logs and get its operation_Id and invocationId values.

  2. Go to monitor view again, select any execution and then "Run query in Application Insights" enter image description here Now you only need to replace operation_Id and invocationId values with those you got at step 1 and run again the query to get full log of that specific execution. enter image description here

like image 148
gsubiran Avatar answered Sep 14 '25 22:09

gsubiran