Azure App Service instance name different than Application Insights instance name

Jason Donnell 10 Reputation points
2023-02-01T17:14:04.6166667+00:00

When running Application Insights for a .NET Core app on a Linux-based Azure App Service, the instance name is reported differently when viewing monitoring information on the App Service versus viewing Insights information. This is not the case on Windows-based App Services.

For example, on Linux the App Service will report an instance name as something like pl1sdlwk0002C7 but in Insights it will show up as something like 09af7ca7e834 . This makes it impossible to correlate anomalous instance behavior reported by the App Service with the available Insights data. Does anyone know what causes this or how to make them match up?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,812 questions
{count} vote

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 20,106 Reputation points
    2023-02-06T07:40:28.6333333+00:00

    @Jason Donnell thank you for this question.

    The difference in the instance name reported in App and the telemetry in Application Insights seems to be related to way the web app is hosted in Linux based vs Windows based App Service. Linux apps in App Service run in their own containers. Therefore, it might be possible that the instance name reported by Azure App Service on Linux may be different from the current instance because the app may be running on a different container than the one it was previously running on.

    In order to avoid such issues, I would suggest using ITelemetryInitializer to override the default telemetry context's "Role Name" and "Role Instance". This would bring in uniformity in the application's instance name as reported by app and in the telemetry being sent to AppInsights. Please see this link for details - Set or override cloud role name.

    Please let me know if you have any questions.

    0 comments No comments