diff --git a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java index 1bad8031e2c..aeb6fae6f47 100644 --- a/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java +++ b/agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/configuration/ConfigurationBuilder.java @@ -3,6 +3,7 @@ package com.microsoft.applicationinsights.agent.internal.configuration; +import com.azure.monitor.opentelemetry.exporter.implementation.statsbeat.RpAttachType; import com.azure.monitor.opentelemetry.exporter.implementation.utils.HostName; import com.azure.monitor.opentelemetry.exporter.implementation.utils.Strings; import com.fasterxml.jackson.core.JsonParseException; @@ -478,7 +479,8 @@ private static Configuration loadConfigurationFile(Path agentJarPath) { return getConfiguration(runtimeAttachedConfigurationContent, JsonOrigin.RUNTIME_ATTACHED); } - if (SdkVersionPrefixHolder.isRpIntegration()) { + // only RP auto integrations do not support loading applicationinsights.json + if (RpAttachType.getRpAttachType() == RpAttachType.INTEGRATED_AUTO) { // users do not have write access to agent directory in rp integrations // and rp integrations should not use applicationinsights.json because that makes it difficult // to merge rp intent and user intent