Skip to content

Add project managed identity Search role + fix Ep1 model example (#5, #38, #75)#82

Open
farzad528 wants to merge 1 commit into
mainfrom
farzad528/cookbook-rbac-and-model-fixes
Open

Add project managed identity Search role + fix Ep1 model example (#5, #38, #75)#82
farzad528 wants to merge 1 commit into
mainfrom
farzad528/cookbook-rbac-and-model-fixes

Conversation

@farzad528

Copy link
Copy Markdown
Collaborator

Summary

Two community-reported fixes for the Foundry IQ cookbooks, both incorporated from contributor PRs that could not merge cleanly after the repo was restructured under Foundry-IQ/.

1. Grant the Foundry project managed identity a Search role - addresses #5

The deployment previously assigned Azure AI Search roles only to the human user, never to the Foundry project's managed identity. As a result the agent + Knowledge Base MCP flow failed with the masked 401 / 405 errors from #5 unless you assigned the role by hand.

infra/main.bicep now grants the project's system-assigned managed identity Search Index Data Reader on the search service (scoped, least-privilege). Verified against the canonical agentic retrieval pipeline docs - the project managed identity needs exactly this role. infra/azuredeploy.json regenerated from Bicep via az bicep build.

Incorporates @alexmanie's PR #75.

2. Fix the Episode 1 model deployment example

Episode 1 still showed FOUNDRY_MODEL_DEPLOYMENT_NAME=gpt-4o in one place, inconsistent with gpt-4o-mini used everywhere else in the notebook, the README, and the default deployment. Corrected to gpt-4o-mini.

Incorporates @satodayo's PR #38.

Also

Validation

  • az bicep build succeeds (only pre-existing warnings); the new role assignment is present in azuredeploy.json, scoped to the search service with correct dependsOn.
  • Episode 1 notebook JSON validated; no stray gpt-4o references remain.

Closes #5

Two community-reported fixes for the Foundry IQ cookbooks:

- infra: grant the Foundry project's system-assigned managed identity the
  Search Index Data Reader role on the search service. This is the keyless
  RBAC the agent needs to call the Knowledge Base MCP endpoint; without it the
  agent + MCP flow fails with masked 401/405 errors during tool invocation.
  Verified against the canonical agentic-retrieval pipeline docs (project
  managed identity requires exactly Search Index Data Reader). Regenerated
  azuredeploy.json from main.bicep. Addresses #5.

- Episode 1: correct the FOUNDRY_MODEL_DEPLOYMENT_NAME example from gpt-4o to
  gpt-4o-mini for consistency with the rest of the notebook, README, and the
  default deployment. Also tightened the agent/MCP troubleshooting callout to
  match the canonical RBAC (project identity needs only Search Index Data
  Reader) and note the Bicep now assigns it automatically.

Co-authored-by: Akira Sato <satodayo@users.noreply.github.com>
Co-authored-by: Alex Mane <alexmanie@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Foundry Agent Service + Search KB MCP tool fails with masked errors (401/405) during agent invocation

1 participant