I have ASP.NET Core MVC project (one of these new-fangled things that starts up as a console app) in Visual Studio Community 2015 Update 3 hosted on Azure App Services. I'm trying to set up Application Insights, mostly because I'd like to capture diagnostic traces with the ApplicationInsightsTraceListener
but the other features are useful too. I have yet to stumble upon the correct configuration to get anything at all to show up in the Azure Portal.
I added Application Insights support to my project using the Visual Studio extension. However, and this seems to be where things start going wrong, it does not create an ApplicationInsights.config
. It adds some DLLs, and puts the InstrumentationKey
in my app settings file, and I have manually added some more assemblies via NuGet, including Microsoft.ApplicationInsights.Web
and Microsoft.ApplicationInsights.TraceListener
. Publishing at this point results in no metrics being enabled in the Azure Portal, and the Live Stream telling me Not available: your app is offline or using an older SDK.
I have tried both 2.1.0 and a 2.2.0 beta. I have tried deleting all the Application Insights stuff, reinstalling the extension and starting again. I have also tried to skip using the extension, manually adding Microsoft.ApplicationInsights.Web
et al, which some google results implied should create the config file also, but with no luck. I have downloaded other people's ApplicationInsights.config
files from the web and attempted to make them sensible for my environment. At no point has anything ever worked in the Application Insights part of the portal.
What extra steps should the extension have taken in addition to creating a config file? Do I need to add code to my Startup.cs
? Most of the documentation just seems to take for granted that the initial setup works.