Llama Index access with Azure OpenAI Managed Identity #13496
-
When trying to access llama-index using Azure OpenAI, is it possible to use Azure Managed Identity instead of adding api_key in parameter? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, you can access the Llama Index using Azure OpenAI with Azure Managed Identity instead of directly providing an Here's a brief overview of what you need to do:
This approach requires some setup on the Azure side, including configuring Azure AD token provider and ensuring your application has the correct permissions to access the necessary Azure resources. Additionally, be aware of any limitations with the embedding model, region, model version, and the requirement for a deployment name when initializing For detailed implementation, refer to the source code and documentation provided in the Llama Index GitHub repository. This will guide you through setting up Azure Managed Identity, refreshing the Azure AD token, and initializing
|
Beta Was this translation helpful? Give feedback.
Yes, you can access the Llama Index using Azure OpenAI with Azure Managed Identity instead of directly providing an
api_key
. The process involves setting theuse_azure_ad
field toTrue
in theAzureOpenAI
class, which then uses Azure AD for token authentication. This method leverages theDefaultAzureCredential
from theazure.identity
package to authenticate and obtain tokens for Azure Cognitive Services access, ensuring a secure and convenient authentication method without the need for explicit API keys.Here's a brief overview of what you need to do:
use_azure_ad
field is set toTrue
to enable Azure AD authentication.DefaultAzureCredential
method to handle authentica…