microsoft / kernel-memory

RAG architecture: index and query any data using LLM and natural language, track sources, show citations, asynchronous memory patterns.
https://microsoft.github.io/kernel-memory
MIT License
1.34k stars 252 forks source link

Support Managed Identity Authentication for AI Search #529

Closed nhandangms closed 1 month ago

nhandangms commented 1 month ago

Context / Scenario

Hi team, Our AI service is using Kernel Memory for retrieval part from Azure Cognitive Search (AI Search) memory. We are going to move from authentication using access key to managed identity as soon as possible.

Question

Have Kernel Memory support Managed Identity Authentication for AI Search yet? If yes, can we get more details on how to set it up, please? If not, can we get some ETA plan on when this feature can be delivered, please?

dluc commented 1 month ago

hello there, yes Managed Identities are supported, here's a quick example:

var builder = new KernelMemoryBuilder()
  .WithAzureAISearchMemoryDb(new AzureAISearchConfig { Auth = AzureAISearchConfig.AuthTypes.AzureIdentity })
  .WithAzureBlobsDocumentStorage(new AzureBlobsConfig { Auth = AzureBlobsConfig.AuthTypes.AzureIdentity })
  .WithAzureOpenAITextGeneration(new AzureOpenAIConfig { Auth = AzureOpenAIConfig.AuthTypes.AzureIdentity })
  .WithAzureOpenAITextEmbeddingGeneration(new AzureOpenAIConfig { Auth = AzureOpenAIConfig.AuthTypes.AzureIdentity })
nhandangms commented 1 month ago

Great, thank you so much your prompt reply.