Skip to content

Commit

Permalink
fix(proxy_server.py): use default azure credentials to support azure …
Browse files Browse the repository at this point in the history
…non-client secret kms
  • Loading branch information
krrishdholakia committed Sep 17, 2024
1 parent 815d46f commit 246548e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions litellm/proxy/proxy_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def load_from_azure_key_vault(use_azure_key_vault: bool = False):
return

try:
from azure.identity import ClientSecretCredential
from azure.identity import ClientSecretCredential, DefaultAzureCredential
from azure.keyvault.secrets import SecretClient

# Set your Azure Key Vault URI
Expand All @@ -670,9 +670,10 @@ def load_from_azure_key_vault(use_azure_key_vault: bool = False):
and tenant_id is not None
):
# Initialize the ClientSecretCredential
credential = ClientSecretCredential(
client_id=client_id, client_secret=client_secret, tenant_id=tenant_id
)
# credential = ClientSecretCredential(
# client_id=client_id, client_secret=client_secret, tenant_id=tenant_id
# )
credential = DefaultAzureCredential()

# Create the SecretClient using the credential
client = SecretClient(vault_url=KVUri, credential=credential)
Expand Down

0 comments on commit 246548e

Please sign in to comment.