Hi Barry Briggs,
Thanks for all the details. Based on what you have shared, the issue is not with encryption or Key Vault, it’s most likely that the AI Foundry Web App is trying to access Azure Cognitive Search using Managed Identity, which hasn’t been enabled or granted the right permissions.
Even if you didn’t set this up manually, the default app is often wired to use Managed Identity for security. So, when you switched to a new index, the app likely tried to use MI for authentication and failed which explains the ManagedIdentityIsNotEnabled
error.
You have two ways to fix this:
Option 1: Enable Managed Identity for your Web App and grant it access to the Cognitive Search index.
Here’s how:
In the Azure Portal, go to your Web App → Identity → enable System-assigned identity.
- Then go to your Azure Cognitive Search resource → Access Control (IAM) → assign the Search Index Data Reader role to the Web App’s identity.
Docs for reference: Enable Managed Identity, Assign Search roles
Option 2: If you’d rather not use Managed Identity, you can modify the Web App code to authenticate with the Azure Search API key instead. This matches how it works in the Foundry Playground.
var searchClient = new SearchClient(
new Uri("https://<your-search-service>.search.windows.net"),
"<index-name>",
new AzureKeyCredential("<your-api-key>"));
Either approach will work it just depends on whether you want to stick with the default (Managed Identity) or go with API keys for now.
Hope it helps!
Please do not forget to click "Accept the answer” and Yes
wherever the information provided helps you, this can be beneficial to other community members.
If you have any other questions or still running into more issues, let me know in the "comments" and I would be happy to help you.