microsoft-foundry / microsoft-foundry/foundry-samples

Bug: azure_ai_search migration fails — index_connection_id not remapped to project_connection_id

Open
#807 1 comment 0 reactions 2 assignees View on GitHub

@brandom-msft is already working on this.

Since Jul 4, 2026.

bug
Dominant language
Bicep
Stars
445
Forks
494
Avg merge
11h 35m
Merged PRs (30d)
38

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.