0
votes

I'm trying to get application insights to work in azure batch job/task while running through a .net core 3.1 console application.

When I run the console app through Visual Studio debug or directly on a node in the batch pool, I get all the appropriate telemetry and logs. However when I setup a task to run the console app I'm not getting any data in application insights.

Guides I looked through:

Is there anyway to get the AppInsights data when running the console app through the task?

edit I have added a TelemetryClient.Flush and Thread.sleep to the end of the process. I can now see explicit calls to TelemetryClient.TrackedEvents but I'm not getting any dependency information, such as SQL call, api calls etc.This only happens to calls made inside a Task. If the console application gets called through a regular command line all information is visible.

1

1 Answers

0
votes

Probably the issue is that the console app closes before telemetry is sent. you'll need to explicitly call "flush" on the telemetry client/etc and wait some time to allow telemetry to be sent.

see: TelemetryClient produces inconsistent results in Application Insights