question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Application Insights in .net core API + WebJob

See original GitHub issue

We experienced issues when we have a project configured with both AI telemetry and AI webjobs.

Repro steps

  1. .net core (3.1) API connected to Application Insights with .AddApplicationInsightsTelemetry in Startup’s ConfigureServices, as documented here.

  2. web job in the same API. The logging there does not work without an extra configuration. For it to work, we connected again to Application Insights with .AddApplicationInsightsWebJobs in Program.cs, as documented here.

Expected behavior

Web jobs’ logging is seen in Application Insights as well as all API telemetry (including requests and dependencies).

Actual behavior

If the configuration for the web job is applied, we stop receiving API’s logs of type “request” and “dependency”. Without those also other Applications Insights features aren’t available, like the application map.

Known workarounds

(none)

Related information

Microsoft.Azure.WebJobs 3.0.22 Microsoft.ApplicationInsights.AspNetCore - not directly referencing; version used: 2.18.0, referenced through Microsoft.Azure.WebJobs.Logging.ApplicationInsights 3.0.18

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
v-bbalaiagarcommented, Dec 14, 2021

Hi @joaocpribeiro , Thank you for your feedback! We will check for the possibilities internally and update you with the findings.

0reactions
SantiagoSanMartincommented, Mar 15, 2023

Hello, we are facing the same issue! We have a problem in production and really need this functionality to troubleshoot

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial: Get started with the Azure WebJobs SDK for event ...
In the web app under Settings, choose Application Insights, and select Turn on Application Insights. Verify the generated Resource name for the ...
Read more >
Use Azure Application Insights with Azure WebJob
The Azure documentation covers many examples of integrating Azure Application Insights into different applications types, such as ASP.NET, Java, ...
Read more >
Logging to Application Insights from Azure App Service ...
Azure WebJob logging has changed. Application Insights is a logical choice to use for this. Featurewise it gives you great power. But with...
Read more >
Azure Webjobs, Application Insights, and You: A Vaguely ...
Step 1: Make The Project Step 2: Create an Application Insights Resource Step 3: Update the App Step 4: Install the Application Insights...
Read more >
Microsoft.Azure.WebJobs.Logging.ApplicationInsights 3.0.35
This package contains the runtime assemblies for Microsoft.Azure.WebJobs.Logging.ApplicationInsights. For more information, please visit ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found