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

ConnectionString not read from appsettings.json when using AddApplicationInsightsTelemetry(ApplicationInsightsServiceOptions) #1726

Closed
cijothomas opened this issue Mar 12, 2020 · 0 comments
Assignees
Milestone

Comments

@cijothomas
Copy link
Contributor

Describe your environment. Describe any aspect of your environment relevant to the problem:

  • SDK version: All
  • .NET runtime version (.NET or .NET Core, TargetFramework in the .csproj file): .NET Core
  • Hosting Info (IIS/Azure WebApps/etc):
  • Platform and OS version:

If you're reporting a problem with a specific version of a library in this repo, please check whether the problem has been fixed on master.

Steps to reproduce.
Create a new Asp.Net Core App, follow doc to onboard to SDK.
Put ConnectionString in appsettings.json
Modify ConfigureServices.cs to enable AI as below:
var aiOptions = new ApplicationInsightsServiceOptions();
aiOptions.EnableSampling = false;
services.AddApplicationInsightsTelemetry(aiOptions);

What is the expected behavior?
ConnectionString should be still read from appsettings.json

What is the actual behavior?
What did you see instead?
ConnectionString was not read from appsettings.json, hence no telemetry was reported. VS debugger shows 'unconfigured' telemetry items locally.
Additional context.
Add any other context about the problem here.
services.AddApplicationInsightsTelemetry() is reading connectionstring as expected from appsettings.json

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

No branches or pull requests

3 participants