
Read the message
(AuthorizationFailed) The client 'dev@contoso.com' with object id '1a2b...'
does not have authorization to perform action
'Microsoft.Network/virtualNetworks/subnets/join/action'
over scope '/subscriptions/.../resourceGroups/net-rg/providers/Microsoft.Network/virtualNetworks/hub-vnet/subnets/app'
or the scope is invalid. If access was recently granted, please refresh your credentials. This example is a classic: the user can create a VM in their own resource group but cannot join a subnet that lives in the network team's resource group. Permissions are needed on both scopes.
Common causes
| Cause | Fix |
|---|---|
| No role at that scope | Assign a role (e.g. Contributor, or a narrower built-in role) at the scope in the message |
| Role lacks one action | Cross-resource actions such as subnet join, Key Vault secrets or role assignments need extra roles |
| Access just granted | Wait up to a few minutes, then az logout / az login or refresh the token |
| Wrong subscription or tenant | az account show; switch with az account set -s <id> |
| Service principal / managed identity missing role | Assign the role to the app's identity, not to your user |
| Deny assignment or locked resource | Managed apps and blueprints add deny assignments; resource locks block deletes and changes |
Fix it step by step
- Confirm who you are and where:
az account showandaz ad signed-in-user show(or the identity of your pipeline). - Copy the action and scope from the error message.
- Check existing roles:
az role assignment list --assignee <object-id> --all -o table. - Find a built-in role that includes the action (search the action in the Azure built-in roles list), and prefer the narrowest one.
- Assign it at the scope in the error:
az role assignment create --assignee <id> --role "Network Contributor" --scope <scope>. You need Owner or User Access Administrator to do this. - Wait a few minutes, sign in again and retry.
- If the error is "RequestDisallowedByPolicy" instead, it is Azure Policy, not RBAC: read the policy name in the message and change the resource to comply or ask for an exemption.
RBAC vs Entra ID roles
Azure RBAC roles (Owner, Contributor, Reader...) control Azure resources. Microsoft Entra ID roles (Global Administrator, User Administrator...) control the directory: users, groups, app registrations. Being a Global Administrator does not by itself give access to subscriptions. Mixing these up is a frequent cause of confusion.
Questions
How long does a new Azure role assignment take to work?
Usually seconds to a few minutes. Signing out and in again refreshes your token.
Is Contributor enough for everything?
No. Contributor cannot assign roles, and some data actions (Key Vault secrets, Storage blob data) need their own roles such as Key Vault Secrets User or Storage Blob Data Reader.