33import logging
44import threading
55from dotenv import load_dotenv
6- from azure .identity import DefaultAzureCredential , get_bearer_token_provider
6+ from azure .identity import get_bearer_token_provider
7+ from .azure_credential_utils import get_azure_credential
78from azure .keyvault .secrets import SecretClient
89
910from ..orchestrator .orchestration_strategy import OrchestrationStrategy
@@ -216,7 +217,7 @@ def __load_config(self, **kwargs) -> None:
216217 )
217218
218219 self .AZURE_TOKEN_PROVIDER = get_bearer_token_provider (
219- DefaultAzureCredential (), "https://cognitiveservices.azure.com/.default"
220+ get_azure_credential (), "https://cognitiveservices.azure.com/.default"
220221 )
221222 self .ADVANCED_IMAGE_PROCESSING_MAX_IMAGES = self .get_env_var_int (
222223 "ADVANCED_IMAGE_PROCESSING_MAX_IMAGES" , 1
@@ -361,8 +362,8 @@ def __load_config(self, **kwargs) -> None:
361362 self .OPEN_AI_FUNCTIONS_SYSTEM_PROMPT = os .getenv (
362363 "OPEN_AI_FUNCTIONS_SYSTEM_PROMPT" , ""
363364 )
364- self .SEMENTIC_KERNEL_SYSTEM_PROMPT = os .getenv (
365- "SEMENTIC_KERNEL_SYSTEM_PROMPT " , ""
365+ self .SEMANTIC_KERNEL_SYSTEM_PROMPT = os .getenv (
366+ "SEMANTIC_KERNEL_SYSTEM_PROMPT " , ""
366367 )
367368
368369 self .ENFORCE_AUTH = self .get_env_var_bool ("ENFORCE_AUTH" , "True" )
@@ -416,7 +417,7 @@ def __init__(self) -> None:
416417
417418 The constructor sets the USE_KEY_VAULT attribute based on the value of the USE_KEY_VAULT environment variable.
418419 If USE_KEY_VAULT is set to "true" (case-insensitive), it initializes a SecretClient object using the
419- AZURE_KEY_VAULT_ENDPOINT environment variable and the DefaultAzureCredential .
420+ AZURE_KEY_VAULT_ENDPOINT environment variable and the get_azure_credential .
420421
421422 Args:
422423 None
@@ -428,7 +429,7 @@ def __init__(self) -> None:
428429 self .secret_client = None
429430 if self .USE_KEY_VAULT :
430431 self .secret_client = SecretClient (
431- os .environ .get ("AZURE_KEY_VAULT_ENDPOINT" ), DefaultAzureCredential ()
432+ os .environ .get ("AZURE_KEY_VAULT_ENDPOINT" ), get_azure_credential ()
432433 )
433434
434435 def get_secret (self , secret_name : str ) -> str :
0 commit comments