Error code: 400 - {'error': {'requestid': 'code': 400, 'message': "Invalid AzureCognitiveSearch configuration detected: Call to get Azure Search index failed.

Vijay Gawte 0 Reputation points
2025-02-06T10:49:18.01+00:00

Hello,

I have Virtual machine created in azure, I am trying to access azure open ai and azure search service from virtual machine but it is giving below error Exception Error code: 400 - {'error': {'requestid': '9ad0e3db-ef59-4ffc-9237-fd5970e39c74', 'code': 400, 'message': "Invalid AzureCognitiveSearch configuration detected: Call to get Azure Search index failed. Check if you are using the correct Azure Search endpoint and index name. If you are using key based authentication, check if the admin key is correct. If you are using access token authentication or managed identity of Azure OpenAI, check if the Azure Search has enabled RBAC based authentication and if the user identity or Azure OpenAI managed identity has required role assignments to access Azure Search resource [https://aka.ms/aoaioydauthentication]. If the Azure Search resource has no public network access, make sure enable trusted service of Azure Search.\nAzure Search Error: 403, message='Server responded with status 403.

I have whitelisted Azure VM public IP in open ai and search service networking, but when I am making it public accessible, it is working (I can access both services from VM)

Can anyone help me here?

###################### 2nd issue:

I have tried securing both the services using private endpoints, but still I am getting the above search service error. I have tried to ping private endpoints from Azure VM, and it is resolving the private endpoint IP address.

To again confirm, I created a simple Python script to call the open AI service using the key and endpoint, and I was able to get the response from the VM, but the issue seems to be in the search service.

Am I missing any part while creating a private endpoint for the search service? (I have selected resource as searchservice while creating private endpoint for search service.)

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,174 questions
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,624 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Manas Mohanty (Quadrant Resource LLC) 290 Reputation points Microsoft Vendor
    2025-02-07T05:52:42.07+00:00

    Hi Vijay Gawte!

    Welcome to Azure AI Q and A forum. Thank you for posting your query here.

    Here is analysis and solution on above error trace

    1. Please check your endpoint name and index name.
    2. Please check Search admin key is correct. For Token based authentication/managed identity authentication, please make sure OpenAI managed identity has access to AI search as contributor role from AI search's IAM.
    3. Please confirm you have added OpenAI as trusted resources from trusted instances from AI search firewall. grant-access-to-trusted-azure-services
    4. On Virtual machine - I would strongly recommend bringing the VM to same Virtual network as of AI Search and OpenAI instead of whitelisting public Ip of public Virtual machine. create-a-virtual-machine-with-in-Vnet

    Hope above pointer help solve your issue. Please don't forget to upvote this answer if it was helpful.

    Thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.