Does OpenTelemetry setting of Container Apps Environment actually work?

Shigeru Nakagaki 120 Reputation points
2025-08-05T03:34:52.2433333+00:00

Hello

I'm trying Function Optimized Container Apps.

I read this article. I configured settings of Container Apps Environment.

resource "azapi_update_resource" "container_apps_environment" {
  type      = "Microsoft.App/managedEnvironments@2025-02-02-preview"
  name      = azurerm_container_app_environment.main.name
  parent_id = data.azurerm_resource_group.main.id
  body = {
    properties = {
      appInsightsConfiguration = {
        connectionString = data.azurerm_application_insights.main.connection_string
      }
      openTelemetryConfiguration = {
        tracesConfiguration = {
          destinations = ["appInsights"]
        }
        logsConfiguration = {
          destinations = ["appInsights"]
        }
      }
    }
  }
}
    "properties": {
        "provisioningState": "Succeeded",
        "daprAIInstrumentationKey": null,
        "daprAIConnectionString": null,
        "vnetConfiguration": {
            "internal": false,
            "infrastructureSubnetId": "/subscriptions/xxx",
            "dockerBridgeCidr": null,
            "platformReservedCidr": "10.1.0.0/16",
            "platformReservedDnsIP": "10.1.0.2"
        },
        "defaultDomain": "xxx.japaneast.azurecontainerapps.io",
        "staticIp": "xxx",
        "appLogsConfiguration": {
            "destination": "azure-monitor",
            "logAnalyticsConfiguration": null
        },
        "openTelemetryConfiguration": {
            "destinationsConfiguration": null,
            "tracesConfiguration": {
                "includeDapr": false,
                "destinations": [
                    "appInsights"
                ]
            },
            "logsConfiguration": {
                "destinations": [
                    "appInsights"
                ]
            },
            "metricsConfiguration": null
        },
        "zoneRedundant": false,
        "availabilityZones": null,
        "kedaConfiguration": {
            "version": "2.16.1"
        },
        "daprConfiguration": {
            "version": "1.13.6-msft.4"
        },
        "ingressConfiguration": null,
        "eventStreamEndpoint": "https://japaneast.azurecontainerapps.dev/subscriptions/xxx/eventstream",
        "customDomainConfiguration": {
            "customDomainVerificationId": "xxx",
            "dnsSuffix": null,
            "certificateKeyVaultProperties": null,
            "certificateValue": null,
            "certificatePassword": null,
            "thumbprint": null,
            "subjectName": null,
            "expirationDate": null
        },
        "workloadProfiles": null,
        "appInsightsConfiguration": {
            "connectionString": null
        },
        "infrastructureResourceGroup": null,
        "peerAuthentication": {
            "mtls": {
                "enabled": false
            }
        },
        "peerTrafficConfiguration": {
            "encryption": {
                "enabled": false
            }
        },
        "publicNetworkAccess": "Enabled",
        "diskEncryptionConfiguration": null
    },
    "identity": {
        "type": "UserAssigned",
        "userAssignedIdentities": {
            "/subscriptions/xxx": {
                "principalId": "xxx",
                "clientId": "xxx"
            }
        }
    }

I believe the reason the connectionString in appInsightsConfiguration is null is because it's a sensitive value.

When I delete APPLICATIONINSIGHTS_CONNECTION_STRING from environment variable of Container Apps (not Container Apps Environment), there is no traces in transaction search of Application Insights.thanks

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

Accepted answer
  1. Sai Prabhu Naveen Parimi 3,235 Reputation points Microsoft External Staff Moderator
    2025-08-05T09:59:15.5166667+00:00

    Hello @Shigeru Nakagaki

    The OpenTelemetry settings in Azure Container Apps will function as expected when configured properly. The null value for the connectionString in appInsightsConfiguration confirms that it is a sensitive value, intentionally hidden for security purposes.

    If the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable is removed from your Container Apps, traces will not appear in Application Insights. This connection string is critical for the Application Insights SDK to transmit telemetry data. Make sure the connection string is accurately set in your environment variables to ensure successful telemetry data transmission.

    Also, verify that your OpenTelemetry agent is configured to send data to the correct destinations as outlined in your settings.

    References:


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.