AzureSenior

Azure role assignment changes are not taking effect (401)

Azure Resource Manager caches role data, so changes can take up to 10 minutes, and managed identity group changes can take hours. Refresh your token.

What you see

  • Status: 401 (Unauthorized) right after you added or changed a role assignment
  • A removed role assignment still appears for several minutes in PowerShell

What it means

Azure Resource Manager sometimes caches configuration and data to improve performance. A new or removed role assignment is therefore not instant.

How to confirm the cause

  1. 1
    Force a fresh sign-in
    az logout && az login

    Signing out and in refreshes your role assignments in the portal, PowerShell and CLI. For REST calls, refresh the access token.

Causes and fixes

  • Normal ARM caching

    HOW TO TELL
    The change was made minutes ago.
    FIX
    Wait up to 10 minutes, and sign out and in (or refresh your token) to force a refresh.
  • Managed identity group membership

    HOW TO TELL
    A managed identity was added to a group that holds the role.
    FIX
    The back-end services for managed identities cache per resource URI for around 24 hours, so group or role membership changes can take several hours to apply. Plan for that delay in any rollout that depends on it.
  • Management group scope with data actions

    HOW TO TELL
    A built-in role with DataActions was added or removed at management group scope.
    FIX
    Data plane access may not update for several hours. Plan the change window accordingly.

How to stop it coming back

  • Do not put a role assignment and the first call that needs it in the same pipeline step. Add a retry with a delay.
  • Verify removals by listing assignments at subscription scope, as PowerShell's per-principal listing can use a cache for about 10 minutes.

Keep going

Sources

Microsoft Learn (learn.microsoft.com), read 18 Nov 2026. The page's own metadata shows it was last updated 5 Nov 2026.

Search

Search cheat sheets and projects