I figured out a workaround. I created the KB manually via the Python SDK as discussed in this article https://learn.microsoft.com/en-us/azure/search/agentic-retrieval-how-to-create-knowledge-base?tabs=rbac&pivots=python#create-a-knowledge-base . When I add my manually created KB to my agent, it works. Here's my script which I modified from the original to use a user assigned identity (as Aryan mentioned, system assigned identity is not supported by AI Search yet). Note I had to remove some fields mentioned in the article which are not supported by the SDK yet.
from azure.identity import DefaultAzureCredential
from azure.search.documents.indexes import SearchIndexClient
from azure.search.documents.indexes.models import (
SearchIndexerDataUserAssignedIdentity,
KnowledgeBase,
KnowledgeBaseAzureOpenAIModel,
KnowledgeSourceReference,
AzureOpenAIVectorizerParameters,
)
index_client = SearchIndexClient(endpoint = "https://---.search.windows.net", credential = DefaultAzureCredential())
aoai_params = AzureOpenAIVectorizerParameters(
resource_url = "https://---.openai.azure.com",
deployment_name = "---",
model_name = "gpt-5",
auth_identity = SearchIndexerDataUserAssignedIdentity(resource_id= "/subscriptions/---/resourcegroups/---/providers/Microsoft.ManagedIdentity/userAssignedIdentities/---")
)
knowledge_base = KnowledgeBase(
name = "----",
description = "---.",
knowledge_sources = [
KnowledgeSourceReference(name = "ks-weekend-events"),
],
models = [KnowledgeBaseAzureOpenAIModel(azure_open_ai_parameters = aoai_params)],
)
index_client.create_or_update_knowledge_base(knowledge_base)
print(f"Knowledge base '{knowledge_base.name}' created or updated successfully.")