wasAsked.

How do you add roles in azure portal using RBAC?

Wipro · Role not specified · technical

Published

Year not specified · Azure

Community answers

Posted by wasAsked editorial collection

Azure role-based access control (RBAC) grants permissions by assigning a role to a security principal at a scope. Three parts of every assignment - Security principal: who — a user, a group, a service principal or a managed identity. - Role definition: what — a collection of permissions. Built-in examples: Owner, Contributor, Reader, User Access Administrator, and service-specific roles such as Storage Blob Data Reader, Key Vault Secrets User and Azure Service Bus Data Sender. - Scope: where — management group, subscription, resource group or a single resource. Permissions inherit downwards. Steps in the Azure portal 1. Open the target scope (for example the resource group or a storage account). 2. Select Access control (IAM). 3. Choose Add, then Add role assignment. 4. Pick the role (use the search; prefer the least-privileged role that fits). 5. On the Members tab, choose "User, group, or service principal" or "Managed identity", then select members. 6. Optionally add conditions (for example storage conditions on blob paths), then Review + assign. 7. Verify with the "Check access" tab or the Role assignments list. Command-line equivalent: az role assignment create --assignee <object-id-or-upn> --role "Storage Blob Data Reader" --scope /subscriptions/<sub>/resourceGroups/rg-app/providers/Microsoft.Storage/storageAccounts/mystorage Custom roles If no built-in role fits, create a custom role with specific Actions and DataActions (JSON definition), then assign it the same way. Important distinctions - Control plane vs data plane: Contributor can manage a storage account but cannot read blob data unless it also has a data role such as Storage Blob Data Reader. - Azure RBAC (resource access) is separate from Microsoft Entra roles (directory administration, such as Global Administrator). - Deny assignments and Azure Policy can further restrict access. Best practices - Assign roles to groups rather than individual users. - Least privilege and the narrowest scope possible. - Use managed identities for applications. - Use Privileged Identity Management (PIM) for just-in-time elevation of high-privilege roles. - Review assignments regularly and manage them as code (Bicep or Terraform) for consistency.

Ravindra Wadile · · 0 likes

Sign in to add your answer

Related interview topics