Microsoft Entra ID is Azure's identity system. Authentication proves an identity; authorization decides what it may do. Azure role-based access control combines a security principal, role definition, and scope. Managed identity gives an Azure workload an Entra identity without storing a client secret in application configuration.
Lab: 35 minutes · Cost: no separate charge for basic RBAC or managed identity · Risk: access changes can lock people out or grant excessive privilege; use a learning scope.
An app registration describes an application in its home tenant. A service principal is that application's local identity instance in a tenant. Do not call every service principal a managed identity; managed identities are a specialized, Azure-operated form.
Built-in roles include Reader, Contributor, Owner, and specialized data roles. Contributor can manage resources but cannot grant Azure RBAC access. Owner can manage resources and access. Data-plane actions often need a data role such as Storage Blob Data Contributor; management Contributor alone may not read blob content.
Ways to build
Choose the Azure tool you want to use. The underlying resource stays the same.
Open a subscription, resource group, or resource → Access control (IAM).
Assign groups instead of many individuals. Choose the narrowest practical scope. Use privileged identity management and time-bound activation in eligible enterprise tenants.
RBAC changes can take minutes to propagate. Do not respond by granting a broader role immediately.
Many resources expose Identity → System assigned → On in the portal. CLI examples are resource-specific. For a web app:
Grant only the required data role at the target resource:
Application code then uses the Azure Identity library's default credential chain. It receives a short-lived token; it does not need the vault secret in configuration.
Bicep attaches an identity to a supported resource:
Role assignments require a deterministic GUID name based on scope, principal, and role; use a documented built-in role definition ID. In Terraform, use the resource's identity block and azurerm_role_assignment. Do not use role names that vary by localization when a stable ID is available.
Use it for an external automation system that cannot have managed identity. Prefer OpenID Connect workload identity federation over a client secret. If a legacy secret is unavoidable, store it in an approved secret manager, rotate it, restrict scope, monitor its use, and set an expiry.
Never create an application identity with Owner at subscription scope because a deployment pipeline “might need it.” Discover required actions from the deployment and create a custom role only when built-in roles are too broad or too narrow.
Remove the exact assignment when finished: