-
-
Notifications
You must be signed in to change notification settings - Fork 827
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestpythonPull requests that update python codePull requests that update python code
Description
Compared regular API key authentication, for example, with OpenAI:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.getenv("OPENAI_API_KEY")
)
With Microsoft Entra ID authentication, there is not explicit API key we need to manage anymore, increasing the security and convenience. For example:
from azure.identity import DefaultAzureCredential, get_bearer_token_provider
from openai import AzureOpenAI
token_provider = get_bearer_token_provider(
DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default"
)
api_version = "2024-07-01-preview"
endpoint = "https://my-resource.openai.azure.com"
client = AzureOpenAI(
api_version=api_version,
azure_endpoint=endpoint,
azure_ad_token_provider=token_provider,
)
I was wondering if there is a plan to support Microsoft Entra ID. Thanks!
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or requestpythonPull requests that update python codePull requests that update python code