Search code examples
azureazure-web-app-serviceazure-application-insightsazure-resource-manager

Can Application Insights be used with a Linux Web App running .NET Core 3 runtime?


I am adding an Azure Application Service Plan to my resource group. I'd like it to be a Linux Host for a .NET Core 3 Web API. Furthermore, I'd like to use Application Insights. However, when using the Azure Portal, the option to add Application Insights to a Linux .NET Core 3 application is greyed out. Does Application Insights not currently support. I have another Linux Web App that is using Node LTS as it's runtime and that allowed me to add Application Insights with no issue. Is there something special I need to do to add Application Insights to a .NET Core 3 Web API running in an Azure Linux Web App?

EDIT: Here are some screenshots of what I am seeing Basics Tab Monitoring Tab


Solution

  • Code-less enablement of Application Insights for Asp.Net core is not yet supported for linux. You need to do code-based enablement, which involves installing SDK nugets to your project as documented below: https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core

    Update: Linux support is added for .NET 6.0 onwards. Check doc: https://learn.microsoft.com/azure/azure-monitor/app/azure-web-apps-net-core?tabs=Linux%2Cwindows