From d7140332bbff847d4b265360c0cd52515b8ac74e Mon Sep 17 00:00:00 2001 From: Harmanpreet Kaur Date: Thu, 22 Jan 2026 10:47:44 +0530 Subject: [PATCH 1/2] fix: disable Azure SDK auto-instrumentation to prevent response format errors --- src/backend/api/api_routes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/backend/api/api_routes.py b/src/backend/api/api_routes.py index 8a3be72f..296d4fd4 100644 --- a/src/backend/api/api_routes.py +++ b/src/backend/api/api_routes.py @@ -43,9 +43,14 @@ instrumentation_key = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING") if instrumentation_key: # Configure Application Insights if the Instrumentation Key is found - configure_azure_monitor(connection_string=instrumentation_key) + configure_azure_monitor( + connection_string=instrumentation_key, + instrumentation_options={ + "azure_sdk": {"enabled": False}, # Don't modify Azure SDK HTTP responses + } + ) logging.info( - "Application Insights configured with the provided Instrumentation Key" + "Application Insights configured with Azure SDK instrumentation disabled" ) else: # Log a warning if the Instrumentation Key is not found From 87653f0f5e841644f8e55858b2e993b586437894 Mon Sep 17 00:00:00 2001 From: Harmanpreet-Microsoft Date: Tue, 27 Jan 2026 18:12:44 +0530 Subject: [PATCH 2/2] Update logging message for Application Insights configuration --- src/backend/api/api_routes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/api/api_routes.py b/src/backend/api/api_routes.py index 296d4fd4..1350c04f 100644 --- a/src/backend/api/api_routes.py +++ b/src/backend/api/api_routes.py @@ -46,11 +46,11 @@ configure_azure_monitor( connection_string=instrumentation_key, instrumentation_options={ - "azure_sdk": {"enabled": False}, # Don't modify Azure SDK HTTP responses + "azure_sdk": {"enabled": False}, } ) logging.info( - "Application Insights configured with Azure SDK instrumentation disabled" + "Application Insights configured with the provided Instrumentation Key" ) else: # Log a warning if the Instrumentation Key is not found