I had the same problem and message in Azure Portal with App Insights, Live metrics and Application Map not working. After browsing several solution descriptions I would like to give you the essence of my solution.
First of all: I started from scratch and straight forward. I had no firewall issue.
But in addition to the answer here on social.msdn.com I will give you my way in more details.
Be aware: This solution was developed and tested using .Net 6.0 with EF 6.0.
I require all prerequisites for using an azure web app are set up!
I did
- setting up necessary azure resources for running a web app using azure cli (there are many resources out there helping you getting around)
- a simple .Net 6 Web app that can be published to azure web app
- setting up application insights in azure
- connecting app insights with web app in azure
- dotnet publish
- run the web app (.azurewebsites.net)
I add following code to my .Net 6 web app StartUp Class to enable Application Insights telemetry
...
public void ConfigureServices(IServiceCollection services)
{
// The following line enables Application Insights telemetry collection*
services.AddApplicationInsightsTelemetry();
}...
therefore Nuget Package
Microsoft.ApplicationInsights.AspNetCore (for me v2.20.0)
was necessary to install.
After that still no data was send to telemetry.
Live metrics say:
"Not available: your app is offline or using an older SDK"
Application Map was not showing anything
further Nuget Packages you need:
Microsoft.ApplicationInsights.PerfCounterCollector (v2.20.0)
Microsoft.ApplicationInsights.Web (v2.20.0)
After that still no data was send to telemetry.
Last but lot least it was my fault:
After redeploying my azure setup for dev (all by Infratructure as code) the Application Insights InstrumentationKey had changed.
So always be sure that InstrumentationKey and ConnectionString are properly set in appsettings.json.
{
"ApplicationInsights": {
"InstrumentationKey": "GUID",
"ConnectionString": "InstrumentationKey=GUID;IngestionEndpoint=https://<location>.in.applicationinsights.azure.com/"
}...
}
You can find the instrumentationKey in overview blade of your Application Insights in Azure Portal as well as using azure cli
az monitor app-insights component show --app yourappinsightsname -g yourressourcegrouname --query instrumentationKey -o tsv
Hint: If you connect Application Insights using Visual Studio (2022 in my case) it will automatically insert Application Insights configuration to your appsettings.json. If you use appsettings.{env}.json be sure
you get them changed also id needed.
All that results in
ApplicationInsights working locally (when set in appsetting.development.json)
Application Map - now working
Live metrics - now working
Hope it helps like it did to me!