Telemetry traces for Functions Optimized Container apps are duplicated in Application Insights transaction logs.

Shigeru Nakagaki 120 Reputation points
2025-08-04T01:18:41.6833333+00:00

hi

i read this article and i setup open telemetry logs for container apps.

it worked. but ah, trace logs in transaction search of application insights are duplicated.

The level of Log is Information in host.json. (if set None level, there is no logs in log analytics.)

The telemetryMode in host.json is "OpenTelemetry". (if set telemetryMode nothing, there is no trace logs in application insights but only user logs.)

the log setting of host.json is below.


  "logging": {
      "fileLoggingMode": "debugOnly",
      "logLevel": {
          "default": "Warning",
          "Host.Aggregator": "Warning",
          "Host.Results": "Warning",
          "Function": "Warning",
          "Function.HealthCheck": "Warning",
          "Function.HealthCheck.User": "Information"
      },
      "console": {
          "isEnabled": false,
          "DisableColors": true
      },
      "applicationInsights": {
          "samplingSettings": {
              "isEnabled": false
          },
          "enableLiveMetricsFilters": true
      }
  },
  "telemetryMode": "OpenTelemetry"

Diagnostic settings for the container app environment are configured.

The Container Apps Environment properties are below.

        "appLogsConfiguration": {
            "destination": "azure-monitor",
            "logAnalyticsConfiguration": null
        },
        "openTelemetryConfiguration": {
            "destinationsConfiguration": null,
            "tracesConfiguration": {
                "includeDapr": false,
                "destinations": [
                    "appInsights"
                ]
            },
            "logsConfiguration": {
                "destinations": [
                    "appInsights"
                ]
            },
            "metricsConfiguration": null
        },

What should I do?

thanks

Azure Container Apps
Azure Container Apps
An Azure service that provides a general-purpose, serverless container platform.
{count} votes

Accepted answer
  1. Sai Prabhu Naveen Parimi 3,470 Reputation points Microsoft External Staff Moderator
    2025-08-07T07:27:39.54+00:00

    Glad to see you figured it out, @Shigeru Nakagaki .

    To summarize the solution: The duplicate logs were caused by both Application Insights and the Container Apps Environment having diagnostic settings that exported telemetry to the same Log Analytics workspace, resulting in duplicated data.

    Since diagnostic settings are required to retain logs long-term, and cannot be removed from all resources, you resolved the issue by removing the diagnostic settings specifically from Application Insights, while keeping them enabled for the Container Apps Environment. This ensures long-term log retention without duplication.

    Thanks for sharing your findings—this will definitely help others facing a similar issue.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.