Need support for Microsoft Intra ID authentication
I have Azure OpenAI deployments on Azure AI Foundry in my organization, we have disabled key based authentication as it is considered insecure, please can you consider to support Azure EntraID authentication?
Hi @wanbao118 , could you help elaborate how you are using Azure AI Foundry models in AI Toolkit right now?
Hi @MuyangAmigo due to our organizational security policy, LLMs deployed on Azure AI Foundry should have API Key based authentication disabled, so normally I can't use our deployments with this VS Code AI Toolkit plugin, but I have to programmatically use Azure SDK to connect to LLMs, below is something works for me in our company.
eg. Using Azure SDK with azure credential provider, so that I can just login Azure by issuing az login, then connect to LLM by running below code.
https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/managed-identity
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"
)
client = AzureOpenAI(
api_version="2024-02-15-preview",
azure_endpoint="https://{your-custom-endpoint}.openai.azure.com/",
azure_ad_token_provider=token_provider
)
response = client.chat.completions.create(
model="gpt-35-turbo-0125", # model = "deployment_name".
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Does Azure OpenAI support customer managed keys?"},
{"role": "assistant", "content": "Yes, customer managed keys are supported by Azure OpenAI."},
{"role": "user", "content": "Do other Azure AI services support this too?"}
]
)
print(response.choices[0].message.content)
Same issue. Is there any plan to support ID authentication?
Our organisation also has the same issue