Share via

Issue with app service

Tommy Sim 20 Reputation points
2025-02-28T00:22:20.54+00:00

I get this error when testing my Azure app

Error

There was an error generating a response. Chat history can't be saved at this time. Error code: 400 - {'error': {'requestid': 'bda40a95-59ee-402b-a54e-5127d9740613', '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. Error message: ', url='https://newentrant.search.windows.net/indexes/silly-date-lm1b9bdl9d?api-version=2024-03-01-preview'\nServer responded with status 403. Error message: "}}

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.

0 comments No comments

Answer accepted by question author

Bhargavi Naragani 7,940 Reputation points Moderator
2025-02-28T04:23:44.1233333+00:00

Hi @Tommy Sim,

The issue seems to be with your Azure Cognitive Search service configuration. The 403-error in particular indicates that your app lacks the correct permissions to use the search index, or something is amiss with the authentication configuration.

Check that the endpoint URL and index name you're specifying in your application are right, you can be able to determine your search service endpoint and indexes in Azure portal, Azure Portal > Cognitive Search > Overview (for endpoint) and Indexes (for index name).

If you're using an admin key, make sure that the admin key you're using is active and accurate. Your keys are available at Azure Portal > Cognitive Search > Keys.

If you're using access token or managed identity, make sure your Azure Cognitive Search has RBAC-based authentication turned on.

Assign the right role (such as Search Index Data Reader or Search Index Data Contributor) to your app's managed identity, you can control role assignment from Azure Portal > Cognitive Search > Access Control (IAM).

If your public network access in Azure Cognitive Search is disabled, ensure that trusted services are enabled, navigate to Azure Portal > Cognitive Search > Networking > Firewalls and virtual networks, and ensure Allow trusted Microsoft services to access this search service is checked.
Managed Identity and Role-Based Access Control (RBAC)
Enable trusted service

If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

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