Microsoft Azure Learning Journey

Beyond Contributor: Design Least-Privilege Azure Access

Custom roles, privileged administration, access reviews, and conditions help control powerful permissions without making every operator an Owner.

11 min read · 2139 words
Microsoft AzureCloud SecurityIdentity and Access ManagementDevOpsCybersecurity
Beyond Contributor: Design Least-Privilege Azure Access cover image

A developer needs to restart one virtual machine. An administrator gives them Contributor at subscription scope because it is quick. The immediate task works, but the developer can now modify or delete far more than that machine. Later, the team cannot tell whether the grant was temporary, whether it is still needed, or who approved it.

Least privilege is not just choosing a smaller role. It means choosing the right permission, principal, scope, duration, and review process—and making sure the access controls reinforce one another.

What you’ll learn

Where this fits

This is Module 6 and Phase 2, Part 2. It builds on Microsoft Entra ID and Azure RBAC fundamentals. Next, Workload Identity Federation applies identity governance to automated deployments.

Prerequisites


Least privilege is a design, not a role name

A role answers what operations a principal can perform. Scope answers where those operations apply. Neither answers when access should be active, whether it was reviewed, or whether the sign-in was acceptable.

A practical access decision specifies:

  1. Principal: a group, person, managed identity, or service principal with an accountable owner.
  2. Operations: the smallest useful built-in or custom role.
  3. Scope: the narrowest resource hierarchy level that supports the task.
  4. Duration: permanent only when justified; time-bound or eligible for elevated access when appropriate.
  5. Conditions: additional checks only where the service and permission support them.
  6. Review and evidence: a named approver, purpose, and schedule for checking continued need.

Azure RBAC grants can be additive. A narrowly scoped Reader role does not neutralize a broader Contributor assignment inherited from a subscription. Check effective access before concluding a new assignment has reduced permissions.

Use built-in roles first; custom roles only for a real gap

Built-in roles are maintained by Microsoft and are easier to compare against published documentation. Start by identifying the exact operations required, then look for the narrowest built-in role that includes them.

Create a custom Azure RBAC role when a built-in role consistently grants unnecessary permissions or omits a specific required operation. A role definition contains permitted management actions, excluded actions, data actions, excluded data actions, and assignable scopes. NotActions and NotDataActions subtract from the corresponding grant inside that definition; they are not global deny rules and do not cancel another assignment.

Before creating one:

Custom roles are not a substitute for scope: a custom role containing Microsoft.Compute/virtualMachines/restart/action can still apply to every eligible VM at its assignment scope. A custom role also does not create a hard permission boundary if another role assignment grants more.

A read-only role-definition exercise

Choose a built-in role to inspect, such as Virtual Machine Contributor. The command only reads the role definition:

az role definition list \
  --name "Virtual Machine Contributor" \
  --query "[].{Name:roleName, Description:description, Permissions:permissions}" \
  --output json

Look for wildcard operations, data actions, and permissions beyond the task you had in mind. The result describes the role, not the effective access of any specific person. No resources or assignments are changed.

Privileged Identity Management: make high privilege temporary

Microsoft Entra Privileged Identity Management (PIM) supports eligible, time-bounded activation for supported Entra roles, Azure resource roles, and groups. An eligible assignment is not the same as an active grant. A person activates the role when needed, potentially meeting configured requirements such as multifactor authentication, justification, approval, or a time limit.

PIM helps reduce standing access, but it does not replace least privilege:

Do not grant permanent Owner merely because an operator occasionally needs to create role assignments. Use an appropriate access-administration role and scope, and make its activation reviewable.

Access reviews: prove access is still needed

An access review asks designated reviewers to confirm whether a user, group member, guest, or role assignment still needs access. It can cover supported group membership, application access, or privileged assignments, depending on the configuration and licensing.

Reviews are most useful when they have an owner and an action. Define:

A review does not itself guarantee that all Azure permissions have been found. A user may get access from a nested group, an inherited Azure role, a second identity, or an external service permission.

Conditional Access: control sign-in conditions

Microsoft Entra Conditional Access evaluates supported sign-in signals and applies access requirements, such as requiring multifactor authentication or a compliant device. It is an identity-layer access policy, not an Azure RBAC role and not a replacement for resource scope.

Conditional Access policies need careful rollout:

A user who passes Conditional Access can still lack Azure RBAC permissions. A workload with an Azure role can still fail authentication or be blocked by another policy.

Azure RBAC conditions and deny assignments

Azure attribute-based access control (ABAC) lets a role assignment filter some granted permissions using request or resource attributes. Conditions narrow permissions only for supported role actions and services. They are not a general deny mechanism, and a condition does not remove permissions granted by another applicable assignment.

Use a condition when the requirement is attribute-based and the target operation is explicitly supported. Keep the condition readable, test both matching and non-matching cases, and document who maintains the attributes it depends on.

A deny assignment blocks specified operations at a scope, including for principals who might otherwise receive an allow. Azure commonly creates and manages deny assignments to protect resources managed by certain Azure features. They are not an ordinary, general-purpose replacement for a custom role, and users typically cannot create arbitrary deny assignments for their own access design.

When diagnosing a denied action, inspect the assignment, condition, scope, and any relevant deny assignment instead of assuming grants alone determine the result.

Azure Lighthouse: delegated administration across tenants

Azure Lighthouse lets a service provider or managing tenant operate on explicitly delegated Azure scopes in a customer tenant. Customer resources remain in the customer’s subscription; delegated access is visible and governed using Azure’s cross-tenant delegation model.

Lighthouse is intended for managed-service and multi-tenant operations, not as a shortcut around tenant boundaries. Define the allowed principals and roles narrowly, limit delegated scopes, document the customer’s revocation path, and review the delegation regularly. It does not merge Entra directories or grant access to unrelated tenant resources.

Cost implications

The role-definition exercise is read-only and creates no billable resources. Custom roles do not run compute, but PIM, access reviews, and some identity governance capabilities require licenses; access logging and audit retention can also have operational or storage costs. Confirm current licensing and retention charges before rolling out organization-wide governance.

Troubleshooting least-privilege access

Production-readiness checklist

Cleanup

The exercise only reads a built-in role definition. It creates no Azure resources, role definitions, assignments, PIM activations, access reviews, or cross-tenant delegations. No cleanup is required.

Key takeaways

Quick self-check

  1. Does a custom role assignment at subscription scope affect every eligible resource in that subscription?
  2. Can an ABAC condition remove access granted by a separate role assignment?
  3. Does Conditional Access give a user the Azure RBAC permissions to deploy?
  4. Why is a PIM-eligible assignment different from a permanent active role?

Answers

  1. Yes, subject to the role’s allowed operations and other controls.
  2. No. It filters the permissions of its own assignment.
  3. No. It controls supported sign-in conditions, not Azure resource authorization.
  4. Eligible access can require activation and can be time-limited, reducing standing privilege.

References

What’s next

Next, Stop Storing Client Secrets: Azure Workload Identity Federation shows how an external workload can exchange a short-lived OIDC token for an Azure token without a stored client secret.


Series navigation


Disclaimer: Azure services, roles, licensing, and feature support change over time. Verify current requirements before implementation.

Share this article

LinkedIn post draft