Skip to content

Commit acd7f18

Browse files
Merge pull request #562 from microsoft/codeql_fix
fix: codeQL issue fix
2 parents f3f7f41 + 6d13956 commit acd7f18

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/backend/common/config/app_config.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ def get_azure_credential(self, client_id=None):
120120
Credential object: Either DefaultAzureCredential or ManagedIdentityCredential.
121121
"""
122122
if self.APP_ENV == "dev":
123-
return (
124-
DefaultAzureCredential()
125-
) # CodeQL [SM05139] Okay use of DefaultAzureCredential as it is only used in development
123+
return DefaultAzureCredential() # CodeQL [SM05139]: DefaultAzureCredential is safe here
126124
else:
127125
return ManagedIdentityCredential(client_id=client_id)
128126

src/backend/v3/orchestration/orchestration_manager.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import uuid
66
from typing import List, Optional
77

8-
from azure.identity import DefaultAzureCredential as SyncDefaultAzureCredential
98
from common.config.app_config import config
109
from common.models.messages_kernel import TeamConfiguration
1110
from semantic_kernel.agents.orchestration.magentic import MagenticOrchestration
@@ -46,7 +45,7 @@ async def init_orchestration(
4645
max_tokens=4000, temperature=0.1
4746
)
4847

49-
credential = SyncDefaultAzureCredential()
48+
credential = config.get_azure_credential(client_id=config.AZURE_CLIENT_ID)
5049

5150
def get_token():
5251
token = credential.get_token("https://cognitiveservices.azure.com/.default")

0 commit comments

Comments
 (0)