mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
fix(proxy_server.py): use default azure credentials to support azure non-client secret kms
This commit is contained in:
parent
815d46f9e1
commit
246548e553
1 changed files with 5 additions and 4 deletions
|
|
@ -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
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue