Cloud Tech by Victor
DevOpsIntermediate

Azure Active Directory (Entra ID)

How Entra ID identity, app registrations, and role-based access control fit together, and why it governs both human sign-in and workload-to-workload authentication.

Updated 2026-07-223 min read

Overview

Entra ID (formerly Azure Active Directory) is Azure's identity provider for both human sign-in and workload-to-workload authentication, every user, and every application that needs to authenticate, has an identity that traces back to it. Two separate role systems then govern what an authenticated identity can actually do: Entra ID roles for managing identity and directory settings themselves, and Azure RBAC for managing Azure resources. For workloads specifically, managed identities remove the most common source of credential-handling risk, client secrets that need to be stored and rotated, by letting Azure manage the credential entirely.

Quick Reference

ConceptGovernsExample
Entra ID rolesIdentity/directory managementGlobal Administrator, User Administrator
Azure RBACAccess to Azure resourcesContributor, Reader, custom roles
App registrationAn application's identityClient ID, authentication configuration
Managed identityCredential-free workload authenticationA VM or App Service authenticating to Key Vault

Syntax

bash
# Enable a system-assigned managed identity on an App Service -
# no client secret to store or rotate.
az webapp identity assign --name my-api --resource-group rg-app

Examples

bash
# Grant that managed identity access to a Key Vault secret via
# Azure RBAC, scoped to just that resource.
az role assignment create \
  --assignee <managed-identity-object-id> \
  --role "Key Vault Secrets User" \
  --scope /subscriptions/.../resourceGroups/rg-app/providers/Microsoft.KeyVault/vaults/kv-app

Prefer managed identities over client secrets

Whenever a workload runs on Azure compute, a managed identity removes the entire credential-storage and rotation burden. Reach for a service principal with a client secret only when the workload runs outside Azure and has no other option.

Visual Diagram

Common Mistakes

  • Storing a service principal's client secret in application config or source control instead of using a managed identity where the workload runs on Azure compute.
  • Confusing Entra ID roles with Azure RBAC roles, granting someone Global Administrator when they only needed Contributor access to a specific resource group, or vice versa.
  • Granting broad RBAC scope (subscription-level Contributor) for a task that only needed access to one resource group or resource.
  • Forgetting that app registrations and their credentials need their own lifecycle management, expired client secrets on a forgotten app registration are a common source of unexpected outages.

Performance

  • Managed identity token acquisition is handled transparently by the Azure SDKs and cached automatically, adding negligible overhead compared to manually managing and refreshing a client secret.
  • Entra ID authentication and RBAC evaluation happen on the request path for resource access but are designed for low latency; the practical concern is correctness of role scope, not runtime cost.

Best Practices

  • Use managed identities by default for any workload running on Azure compute that needs to authenticate to another Azure service.
  • Scope Azure RBAC role assignments as narrowly as possible, a specific resource or resource group rather than a subscription, unless the access genuinely needs to be that broad.
  • Separate Entra ID directory administration roles from Azure resource RBAC roles when assigning access; they answer different questions and shouldn't default to the same broad grant.
  • Treat any remaining client secrets (for workloads that can't use managed identities) as sensitive, rotate them on a schedule, and store them in Key Vault rather than application config.

Interview questions

What is the difference between Azure RBAC and Entra ID roles?

Entra ID roles (like Global Administrator, User Administrator) control access to Entra ID and Microsoft 365 management functions themselves, managing users, groups, and directory settings. Azure RBAC controls access to Azure resources (VMs, storage accounts, resource groups) via role assignments scoped to a management group, subscription, resource group, or individual resource. They are separate systems that both use Entra ID as the identity provider, a user authenticates once through Entra ID, but what they can then do is governed by two independent role systems depending on whether they're managing identity itself or managing Azure resources.

What is an app registration in Entra ID, and why do workloads need one?

An app registration represents an application's identity in Entra ID, giving it a client ID and the ability to authenticate, either as itself (via a client secret or certificate, for service-to-service calls) or on behalf of a signed-in user (via OAuth 2.0/OpenID Connect flows). Workloads need one because Entra ID authentication and authorization apply uniformly to both humans and applications, a background service calling an API needs its own verifiable identity the same way a person does, and an app registration (often combined with a managed identity to avoid handling secrets directly) is how that identity is established.

What is a managed identity, and what problem does it solve compared to a service principal with a client secret?

A managed identity is an Entra ID identity automatically managed by Azure for a resource (a VM, an App Service, a Function), with credentials that Azure handles entirely, no client secret is ever stored, retrieved, or rotated by the application. A traditional service principal with a client secret requires that secret to be stored somewhere (a config file, a key vault) and rotated manually or via automation, which is itself a credential-management burden and a leak risk. Managed identities remove that burden for the common case of "this Azure resource needs to authenticate to another Azure service," which is why they're preferred whenever the workload runs on Azure compute.

References

ShareXLinkedInReddit
Was this page helpful?
Suggest an improvement