Skip to content

Commit adfc30e

Browse files
authored
Merge pull request microsoft#170 from microsoft/marktayl/fix-key-to-conn-str-telemetry
fix: to pass con str instead of key
2 parents 3e40a7b + 395b7c2 commit adfc30e

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/backend/app_kernel.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
# app_kernel.py
22
import asyncio
3+
import json
34
import logging
45
import os
5-
import uuid
66
import re
7-
import json
8-
from typing import List, Dict, Optional, Any
7+
import uuid
8+
from typing import Any, Dict, List, Optional
99

10-
# FastAPI imports
11-
from fastapi import FastAPI, HTTPException, Query, Request
12-
from fastapi.middleware.cors import CORSMiddleware
10+
# Semantic Kernel imports
11+
import semantic_kernel as sk
12+
from app_config import config
13+
from auth.auth_utils import get_authenticated_user_details
1314

1415
# Azure monitoring
1516
from azure.monitor.opentelemetry import configure_azure_monitor
17+
from config_kernel import Config
18+
from context.cosmos_memory_kernel import CosmosMemoryContext
19+
from event_utils import track_event_if_configured
1620

17-
# Semantic Kernel imports
18-
import semantic_kernel as sk
19-
20-
# Updated import for KernelArguments
21-
from semantic_kernel.functions.kernel_arguments import KernelArguments
21+
# FastAPI imports
22+
from fastapi import FastAPI, HTTPException, Query, Request
23+
from fastapi.middleware.cors import CORSMiddleware
24+
from kernel_agents.agent_factory import AgentFactory
2225

2326
# Local imports
2427
from middleware.health_check import HealthCheckMiddleware
25-
from auth.auth_utils import get_authenticated_user_details
26-
from config_kernel import Config
27-
from context.cosmos_memory_kernel import CosmosMemoryContext
2828
from models.messages_kernel import (
29-
HumanFeedback,
29+
ActionRequest,
30+
ActionResponse,
31+
AgentMessage,
32+
AgentType,
3033
HumanClarification,
34+
HumanFeedback,
3135
InputTask,
3236
Plan,
33-
Step,
34-
AgentMessage,
3537
PlanWithSteps,
36-
ActionRequest,
37-
ActionResponse,
38+
Step,
3839
)
39-
from utils_kernel import initialize_runtime_and_context, get_agents, rai_success
40-
from event_utils import track_event_if_configured
41-
from models.messages_kernel import AgentType
42-
from kernel_agents.agent_factory import AgentFactory
43-
from app_config import config
40+
41+
# Updated import for KernelArguments
42+
from semantic_kernel.functions.kernel_arguments import KernelArguments
43+
from utils_kernel import get_agents, initialize_runtime_and_context, rai_success
4444

4545
# # Check if the Application Insights Instrumentation Key is set in the environment variables
46-
instrumentation_key = os.getenv("APPLICATIONINSIGHTS_INSTRUMENTATION_KEY")
47-
if instrumentation_key:
46+
connection_string = os.getenv("APPLICATIONINSIGHTS_CONNECTION_STRING")
47+
if connection_string:
4848
# Configure Application Insights if the Instrumentation Key is found
49-
configure_azure_monitor(connection_string=instrumentation_key)
49+
configure_azure_monitor(connection_string=connection_string)
5050
logging.info(
5151
"Application Insights configured with the provided Instrumentation Key"
5252
)

0 commit comments

Comments
 (0)