Skip to content

[BUG] role_assignment_list returns empty with status 200 for management-group scopes #3285

Description

@nabysow

Describe the bug

role_assignment_list returns an empty assignment array with
"status": 200, "message": "Success" for a management-group scope that
demonstrably has role assignments. The failure is silent — it is
indistinguishable from a genuine empty result.

Expected behavior

The assignments present at that scope — in our case Reader (acdd72a7-…)
and Cost Management Reader (72fafb9e-…) on the calling SP, plus four user
Owner assignments.

Actual behavior

The assignments present at that scope — in our case Reader (acdd72a7-…)
and Cost Management Reader (72fafb9e-…) on the calling SP, plus four user
Owner assignments.

Verification that the result is wrong

Two independent paths, same credential, same session:

  1. arm / execute_query against authorizationresources returns six
    management-group-scoped assignments, including the two on the calling SP.
  2. az role assignment list --all --assignee <appId> --include-inherited --include-groups under a separate identity returns the same two.

Reader includes Microsoft.Authorization/roleAssignments/read, so this is
not a permissions gap — and a permissions gap should surface as an error,
not as Success.

Why this matters beyond the empty array

The response echoes back no scope, so a caller cannot tell which scope was
actually queried. For an agent consuming this tool, a false empty is worse
than an error: it reads as positive evidence of absence. In our case it
produced a confident, well-formed, entirely wrong conclusion that a
production RBAC assignment was missing.

Reproduction Steps

  1. Assign Reader at /providers/Microsoft.Management/managementGroups/<mg-id>
    to a service principal.
  2. Configure the MCP server with that SP's credentials.
  3. Call role_assignment_list with:
    {"scope": "/providers/Microsoft.Management/managementGroups/<mg-id>"}

Environment

  • Azure MCP Server 2.0 via npx -y @azure/mcp@latest server start
  • Client: Claude Code (VS Code extension), macOS
  • Credential: service principal via AZURE_TENANT_ID / AZURE_CLIENT_ID /
    AZURE_CLIENT_SECRET, holding Reader + Cost Management Reader at the
    management group being queried

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions