@NewGyu commented on Thu Feb 13 2020
> By calling the UseApplicationInsights extension method on IWebHostBuilder
It seems to that UseApplicationInsights method has been already marked as obsolete.
https://github.com/microsoft/ApplicationInsights-dotnet/blob/2.12.1/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/ApplicationInsightsWebHostBuilderExtensions.cs#L17
And IWebHostBuilder will be deprecated.
https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.1&tabs=visual-studio#hostbuilder-replaces-webhostbuilder
Is UseApplicationInsights extension method standard?
⚠ このセクションを編集しないでください。 docs.microsoft.com で必須です ➟ GitHub の問題のリンク。
@srvbpigh commented on Thu Feb 13 2020
Hello, @NewGyu
Thank you for your feedback.
We are actively reviewing your comments and will get back to you soon.
Kind regards,
Microsoft DOCS International Team
Hi Team,
Could you please check user's question?
Kind regards,
Microsoft DOCS International Team
@ticianaciminari Thank you for the feedback! We are investigating this and will get back to you shortly.
UseApplicationInsights is marked obsolete and will be removed in the next major version change in the SDK. The alternate is to use AddApplicationInsightsTelemetry.
This is also added in faq in asp.net core doc as well:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core#some-visual-studio-templates-used-the-useapplicationinsights-extension-method-on-iwebhostbuilder-to-enable-application-insights-is-this-usage-still-valid
https://docs.microsoft.com/en-us/azure/azure-monitor/app/ilogger#aspnet-core-applications
when you turn on regular Application Insights monitoring through either of the standard methods:
The above expression make mislead the reader. As @cijothomas says, I think UseApplicationInsights is no longer a standard method. It should be noted that it will be removed in the next major version. In fact, I've been confused.
@NewGyu I am sorry I dont understand the confusion. Ilogger doc states ilogger provider is enabled on both useapplicationinsights, or addapplicationinsightstelemetry , which is correct. The doc about asp.net core specifics - it mentions the method is obsolete.
What change do you propose?
@cijothomas Thank you for replying. The confusion I felt is that UseApplicationInsights is introduced as a standard method. It has already been marked [obsolete] and will be removed. Is the [obsolete] method standard?
When I implemented integration iLogger with Application Insights with UseApplicationInsights according to the document, the compiler reported to me that it is obsolete. I couldn't help saying that : Hey compiler, it is introduced as a standard method in the official document?
I hope that the method is noted that it is still available , but it will be removed in the next major version.
https://docs.microsoft.com/en-us/azure/azure-monitor/app/ilogger#aspnet-core-applications
ASP.NET Core applications
ApplicationInsightsLoggerProvider is enabled by default in Microsoft.ApplicationInsights.AspNet SDK version 2.7.1 (and later) when you turn on regular Application Insights monitoring through either of the standard methods:
- By calling the UseApplicationInsights extension method on IWebHostBuilder <---- I mentioned
- By calling the AddApplicationInsightsTelemetry extension method on IServiceCollection
It looks like @cijothomas addressed these concerns with this PR: https://github.com/MicrosoftDocs/azure-docs/commit/2977faa349a74bff3551eb327c28f44cca9063f6#diff-8d0bbf274d9544994ea2f2cd4fa753d3
I am going to close out this issue. Thank you for bringing this to our attention.
Most helpful comment
UseApplicationInsights is marked obsolete and will be removed in the next major version change in the SDK. The alternate is to use
AddApplicationInsightsTelemetry.This is also added in faq in asp.net core doc as well:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core#some-visual-studio-templates-used-the-useapplicationinsights-extension-method-on-iwebhostbuilder-to-enable-application-insights-is-this-usage-still-valid