Bug Description
The v1_to_v2_migration.py script fails with a 400 error when migrating v1 agents
that have azure_ai_search tools with index_connection_id in their tool_resources.
Error
400 Bad Request: Azure AI Search tool must provide either (project_connection_id and index_name) or (index_asset_id)
Root Cause
The remap_connection_ids_in_tool function (line ~2643) handles the generic
connection_id → project_connection_id rename, but does NOT handle
index_connection_id which is used specifically by azure_ai_search tools.
Fix (4 lines, tested and working)
In migration/v1_to_v2_migration.py, function remap_connection_ids_in_tool,
add an elif branch after the connection_id handling:
elif key == 'index_connection_id':
# v1 azure_ai_search uses index_connection_id, v2 expects project_connection_id
resolved = resolve_connection_id(str(value)) if value else value
result['project_connection_id'] = resolved
Steps to Reproduce
- Have a v1 agent with an azure_ai_search tool that has index_connection_id
- Run: python [v1_to_v2_migration.py] http://vscodecontentref/2) --migrate-connections <assistant_id>
- Observe 400 error
Bug Description
The
v1_to_v2_migration.pyscript fails with a 400 error when migrating v1 agentsthat have
azure_ai_searchtools withindex_connection_idin their tool_resources.Error
400 Bad Request: Azure AI Search tool must provide either (project_connection_id and index_name) or (index_asset_id)
Root Cause
The
remap_connection_ids_in_toolfunction (line ~2643) handles the genericconnection_id→project_connection_idrename, but does NOT handleindex_connection_idwhich is used specifically byazure_ai_searchtools.Fix (4 lines, tested and working)
In
migration/v1_to_v2_migration.py, functionremap_connection_ids_in_tool,add an
elifbranch after theconnection_idhandling:Steps to Reproduce