Application Insights is not fully supported for .NET 5.0, but you can configure it manually
by Patrick Lee on 03 Feb 2021 in categories tech with tags Application Insights .NET 5.0If you look at a .NET 5.0 App Service (website) in the Azure portal, you will currently (3 Feb 2021) see that the Applications Insight link in the left hand menu is disabled, with a tooltip when you hover over it saying that Application Insights is not yet supported for .NET 5.0.
However, I have found that you can use Application Insights with a .NET 5.0 website, you just have to configure it from within Visual Studio 2019.
Doing that will add the Microsoft.ApplicationInsights.AspNetCore v 2.15.0 nuget package to the project, and it will add the telemetry service to the Startup class:
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
services.AddApplicationInsightsTelemetry(Configuration["APPINSIGHTS_CONNECTIONSTRING"]);
}
After that when you publish the website to Azure, although the Applications Insight link in the left hand menu is still disabled, there will be another link near the top of the Overview view which you can click to configure/view Application Insights.