Azure OpenAI "Bring your own data" failed

441 Views Asked by At

When I try to bring won data with Azure AI Search to Azure OpenAI ChatGPT, I receive an error: "Invalid AzureCognitiveSearch configuration detected: Call to get ACS index failed. Check you are using correct index, instance and api_key."

Here is the picture

I have now idea what is wrong. I have the endpoints and everything, but still not working.

1

There are 1 best solutions below

0
Ram On

Make sure correct assignee was selected when assigning roles.You need to create a managed identity for your client application. Then, you need to grant your managed identity access to your search service. Azure Cognitive Search has various built-in roles, and you can also create a custom role. After that, you can use the managed identity to authenticate to Azure Key Vault and retrieve the search service admin key. You can then use this key to create an instance of the AzureCognitiveSearchChatExtensionConfiguration class. Here's an example of how you can use Managed Identity to retrieve the search service admin key:

var azureServiceTokenProvider = new AzureServiceTokenProvider();
var keyVaultClient = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(azureServiceTokenProvider.KeyVaultTokenCallback));
var searchServiceAdminKey = await keyVaultClient.GetSecretAsync("https://<your-key-vault-name>.vault.azure.net/secrets/<your-search-service-admin-key-name>").ConfigureAwait(false);
var searchServiceEndpoint = "https://<your-search-service-name>.search.windows.net";
var searchServiceIndexName = "<your-search-service-index-name>";
var searchServiceQueryApiKey = "<your-search-service-query-api-key>";

var chatExtensionConfiguration = new AzureCognitiveSearchChatExtensionConfiguration(searchServiceEndpoint, searchServiceIndexName, searchServiceQueryApiKey, searchServiceAdminKey.Value);