From 41ba94d03944f2560e06080a393100e54d075d60 Mon Sep 17 00:00:00 2001 From: Dhruv-Sh-git Date: Thu, 12 Nov 2026 20:13:36 +0530 Subject: [PATCH] =?UTF-8?q?Fix=20Issue=E2=80=AF#9956=20=E2=80=93=20allow?= =?UTF-8?q?=20injected=20Azure=20Search=20clients=20to=20coexist=20with=20?= =?UTF-8?q?connection=20args?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../agent_framework_azure_ai_search/_vector_store.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/packages/azure-ai-search/agent_framework_azure_ai_search/_vector_store.py b/python/packages/azure-ai-search/agent_framework_azure_ai_search/_vector_store.py index 4cfd141ad4f..82f7653a114 100644 --- a/python/packages/azure-ai-search/agent_framework_azure_ai_search/_vector_store.py +++ b/python/packages/azure-ai-search/agent_framework_azure_ai_search/_vector_store.py @@ -302,12 +302,10 @@ def __init__( """ if query_source_credential is not None and not callable(getattr(query_source_credential, "get_token", None)): raise TypeError("query_source_credential must be an Azure TokenCredential or AsyncTokenCredential.") - if (index_client is not None or search_client is not None) and any( - value is not None for value in (endpoint, credential, api_key, env_file_path, env_file_encoding) - ): - raise ValueError( - "Injected clients cannot be combined with endpoint, credential, api_key, or env_file options." - ) + # Allow injected clients to coexist with connection arguments; the injected client takes precedence. + # Previously we raised a ValueError here, but the desired behavior is to ignore the extra arguments. + # This enables callers to pass an already-configured client while still using environment/connection settings elsewhere. + # No action needed – simply proceed without error. super().__init__( record_type, definition=definition,