From 64ed5f4f1f4dd726e81cd45ea815529b4d985ff2 Mon Sep 17 00:00:00 2001 From: FHajHusein <32085305+FHajHusein@users.noreply.github.com> Date: Tue, 29 Sep 2026 20:57:49 +0300 Subject: [PATCH] Add applicationInsightsResourceId to agent's log configuration Otherwise, if existingAgentAppInsightsId is specified, the existing Application Insights won't be set for the agent. --- sreagent-templates/bicep/agent-core.bicep | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sreagent-templates/bicep/agent-core.bicep b/sreagent-templates/bicep/agent-core.bicep index 0ca684525..0bab9bd39 100644 --- a/sreagent-templates/bicep/agent-core.bicep +++ b/sreagent-templates/bicep/agent-core.bicep @@ -78,6 +78,7 @@ resource existingAppInsights 'Microsoft.Insights/components@2020-02-02' existing var effectiveAppInsightsAppId = empty(existingAgentAppInsightsId) ? appInsights.properties.AppId : existingAppInsights.properties.AppId var effectiveAppInsightsConnStr = empty(existingAgentAppInsightsId) ? appInsights.properties.ConnectionString : existingAppInsights.properties.ConnectionString +var effectiveAppInsightsId = empty(existingAgentAppInsightsId) ? appInsights.id : existingAppInsights.id // ── Managed Identity ── @@ -144,6 +145,7 @@ resource sreAgent 'Microsoft.App/agents@2025-05-01-preview' = { applicationInsightsConfiguration: { appId: effectiveAppInsightsAppId connectionString: effectiveAppInsightsConnStr + applicationInsightsResourceId: effectiveAppInsightsId } } upgradeChannel: upgradeChannel