Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console app application insight logging is not working #2947

Open
ruonan0509 opened this issue Jan 16, 2025 · 3 comments
Open

console app application insight logging is not working #2947

ruonan0509 opened this issue Jan 16, 2025 · 3 comments
Labels

Comments

@ruonan0509
Copy link

since Application Insights “Instrumentation Keys” are Sunsetting on March 31, 2025, i am trying to convert current applicationInsights config from Instrumentation Key to Connection String

current startup:

public void ConfigureServices(IServiceCollection services) => services
.AddApplicationInsightsTelemetryWorkerService("00000000-0000-0000-0000-000000000000");

changed to

public void ConfigureServices(IServiceCollection services) => services
.AddApplicationInsightsTelemetryWorkerService(options => options.ConnectionString = "InstrumentationKey="00000000-0000-0000-0000-000000000000");

but the new code is not logging anything to the same AI transaction logging. am I missing anything? thanks!

@ruonan0509 ruonan0509 added the bug label Jan 16, 2025
@TimothyMothra
Copy link
Member

Make sure you copy the ConnectionString verbatim from your Application Insights resource.
If that's not working, you can collect SDK logs to identify any errors within the SDK

@ruonan0509
Copy link
Author

thank you @TimothyMothra getting back to me
here is my AI

Image

the connection string is very long, shall i copy the whole thing or just InstrumentationKey=xxx part?
and also where i can find the SDK logs? thank you!

@TimothyMothra
Copy link
Member

TimothyMothra commented Jan 17, 2025

Yes, full string. The SDK needs those Endpoint values.

Self diagnostics would be the easiest way to collect internal logs: https://github.com/microsoft/ApplicationInsights-dotnet/tree/main/troubleshooting/ETW#self-diagnostics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants