Remove redundant role assignments for hosted agents (service now auto-assigns)
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
## Summary
The Foundry service now automatically assigns required roles to per-agent managed identities on agent creation. The azd agents extension should remove its client-side role assignment logic, which is now redundant.
## Background
The VS Code extension (Skylight) has already removed this logic:
- https://github.com/microsoft/Skylight/pull/4754 — Clean up hosted agent role assignments (simplified to Foundry User only)
- https://github.com/microsoft/Skylight/pull/4910 — Drop client-side per-agent identity role assignment entirely
## Changes needed in azd
| File | Current behavior | Action |
|------|-----------------|--------|
| `internal/project/agent_identity_rbac.go` | Postdeploy assigns "Azure AI User" to each agent MI | Remove (or convert to verify-only) |
| `internal/project/developer_rbac_check.go` | Predeploy checks developer has `roleAssignments/write` | Remove this specific check |
| `internal/cmd/listen.go` | Postdeploy calls `EnsureAgentIdentityRBAC()` | Remove call |
| `resources/scaffold/base/modules/ai-search-conn.bicep` | Assigns Search roles to Project MI | Remove role assignment resources |
| `internal/cmd/doctor/checks_agent_identity_roles.go` | Diagnoses agent MI role assignments | Remove or make info-only |
## Impact
- Faster deploy (no RBAC polling/propagation wait)
- Lower permission requirements for developers (no longer need `roleAssignments/write`)
- Fewer transient failures from RBAC propagation delays
Contributor guide
Assessment
This issue has not been assessed yet.