Hello @Souciance Eqdam Rashti
Thanks for the detailed payloads. Two corrections to what you've already been asked to do, then a test sequence you can complete without waiting on me.
First, the RBAC guidance you were given was wrong :- File search doesn't need broad Contributor. It needs Storage Blob Data Contributor on the project's storage account and Foundry User on the Foundry project. Escalating to Contributor wouldn't have fixed a scope problem, so that result told us nothing. Sorry for the detour.
Second, the store you validated isn't the store that's failing :-
Your toolbox index_epic_whistle_ht0mz00ttd pins vs_aSG7XqAQOxrEUiq6OCW7qDZq. The GET you ran successfully was vs_8D2M1HKOFLQEVB8K8WYJyN3G (index_olden_diamond_qznrgbv023). Different objects the failing one is still untested.
That matters because file_search inside a toolbox requires the file and vector store to be created at the resource-level endpoint with the x-aml-project-id header, using the project GUID from properties.amlWorkspace.internalId. A store created at project scope can return 200 on GET and still not resolve on the toolbox query path — which matches a healthy store, a 500 with no sub-code, and RBAC changes making no difference.
Step 1:- probe the failing store at both scopes. Run both; the pair is what's diagnostic, not either alone.
AGENT_TOKEN=$(az account get-access-token --scope https://ai.azure.com/.default --query accessToken -o tsv)
VS=vs_aSG7XqAQOxrEUiq6OCW7qDZq
# project scope
curl -s -w "\nproject:%{http_code}\n" \
"$FOUNDRY_PROJECT_ENDPOINT/openai/v1/vector_stores/$VS" \
-H "Authorization: Bearer $AGENT_TOKEN"
# account/resource scope (the path the toolbox uses)
curl -s -w "\naccount:%{http_code}\n" \
"$ACCOUNT_ENDPOINT/openai/v1/vector_stores/$VS" \
-H "Authorization: Bearer $AGENT_TOKEN" \
-H "x-aml-project-id: $PROJECT_GUID"
Read it as:
- project 200 / account 404 → scope mismatch. Go to Step 3.
- both 404 → the ID is stale; the index was recreated and the toolbox still points at the old object. Step 3.
- account 200 → check status is completed and file_counts.failed is 0. If files failed ingestion, re-upload; that alone can produce the 500. If it's clean, config is sound → Step 4, then escalation.
Step 2:- read the toolbox's live pinned config. azd ai toolbox show <toolbox-name> --output json. vector_store_ids are immutable for a given toolbox version, so a recreated index always leaves the old version pointing at a dead ID. Confirm the default_version config carries the ID that returned 200 above.
Step 3 :- recreate at account scope and republish. POST {account_endpoint}/openai/v1/files with purpose=assistants and x-aml-project-id: {project-guid}, then POST {account_endpoint}/openai/v1/vector_stores with the returned file ID and the same header. Pin the new ID into a new toolbox version and promote it to default_version.
One catch worth knowing: your agent must be on the unversioned consumer endpoint (https://<account>.services.ai.azure.com/api/projects/<project>/toolboxes/<toolbox-name>/mcp?api-version=v1) for the promotion to take effect. If it's pinned to a versioned developer endpoint, the promotion is silently ignored — a documented symptom. Verify with a tools/call and confirm isError: false with chunk content returned.
Step 4 :- update packages and redeploy. Upgrade Microsoft.Agents.AI.Foundry.Hosting and the agentserver/responses packages, redeploy, and confirm /readiness is healthy — it reports unhealthy specifically when the host can't enumerate toolbox tools, which distinguishes a discovery failure from an execution failure. Then re-run the failing prompt.
On expectations: Step 3 is a documented configuration correction, and I'd expect it to resolve this if Step 1 shows a scope or staleness fault. Step 4 is a defensive SDK refresh. If Step 1 returns account-scope 200 with a completed store and Steps 3–4 change nothing, the fault is in the server-side file-search execution path that needs backend tracing, not more work from you, and I'll escalate with your payloads attached rather than asking you to keep testing.
References
https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/tools/file-search?pivots=python
https://learn.microsoft.com/en-us/azure/foundry/agents/how-to/tools/use-toolbox-hosted-agent?pivots=python
https://learn.microsoft.com/en-us/azure/foundry/agents/concepts/toolbox-overview
Thanks,
Manish.