0

I am building an Azure Function application to write and retrieve logs in ApplicationInsights. I can able to write logs using instrumentation key.

But I don't know how to retrieve the logs from Application Insights. I have googled and got some references to retrieve it through AD credentials but I don't have AD access. Without AD credentials (ClientId, SecretKey), how can I retrieve the logs data from Application Insights?

I need some guidance. Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
SuryaKavitha
  • 493
  • 5
  • 16
  • 36
  • I believe you have excellent coding skills, the rest of you just need to send this http request in the code (same as I tested in postman). – Jason Pan Feb 27 '23 at 05:47

1 Answers1

1

After My test, I found a good blog and verify it. If you don't have AD credentials (ClientId, SecretKey), you can use AppInsightsId, AppInsightsAPIKey. You can find it like below.

enter image description here

There will be some problems in the direct test of the official document(you may found simillar issue here), please rest assured that the official should already know the existence of this problem. My sample Sample works fine. Please check the steps below.

Steps

  1. Find the AppInsights Id and Key like the picture above.

  2. Test in Postman.

    enter image description here

  3. For more details, you can check the blog.

    RETRIEVE APP INSIGHTS LOGS FROM A FUNCTION USING API REST

Jason Pan
  • 15,263
  • 1
  • 14
  • 29