Skip to content

Bug: azure_ai_search migration fails — index_connection_id not remapped to project_connection_id #807

Description

@Ashish-Joshi2304

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_idproject_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:

Image
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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions