Lesson 02 — Microsoft Entra ID: Users, Groups & Identities

Domain 1 — Identity & Governance AZ-104: 20–25% ~30 min Prereq: Lesson 01

Why You Need to Understand This

Every RBAC role assignment, every managed identity, every service calling the Azure API — all of it resolves against Microsoft Entra ID (formerly Azure Active Directory). Entra ID is not just a directory; it is the authentication and identity plane for the entire Azure control surface. RBAC says what a principal can do; Entra ID determines who the principal is.

In the exam, roughly half of all identity questions hinge on knowing the difference between identity object types: member user vs. guest, service principal vs. managed identity, app registration vs. enterprise application. In production, conflating these leads to over-privileged service accounts, unrotated secrets, and hybrid sync failures that take hours to diagnose.

The Tenant as an Identity Boundary

Recall from Lesson 01 that a tenant is the top-level container. From an identity perspective, the tenant is the trust boundary: every identity object (user, group, service principal, managed identity) has exactly one home tenant. Authentication decisions made by Entra ID are always relative to a tenant.

🏢 Tenant (Entra ID instance — your identity plane) ├─ 👤 User objects (members + guests) ├─ 👥 Group objects (security + M365) ├─ 🤖 Service Principals (application identities) └─ 🔑 Managed Identities (resource-bound identities)
One Entra ID, many subscriptions A single Entra ID tenant can be the identity provider for dozens or hundreds of Azure subscriptions. Subscriptions trust exactly one tenant for authentication, but a tenant can back many subscriptions. This is why enterprise governance starts at the tenant, not the subscription.

User Types: Members, Guests, and Hybrid Accounts

Member users vs. Guest users

PropertyMember UserGuest User (B2B)
Home tenantThis tenant — the object was created hereAnother tenant or external IdP — invited via B2B
Default permissionsCan read directory objects (users, groups) by defaultHighly restricted directory read permissions by default
UPN formatuser@contoso.comuser_externaldomain.com#EXT#@contoso.onmicrosoft.com
LicensingRequires a license in this tenant5:1 external guest ratio — 5 guests per P1/P2 license
Typical use caseEmployees, internal service accountsContractors, partners, vendor access to Azure resources

UPN vs. email address — a critical distinction

The User Principal Name (UPN) is the login identifier Entra ID uses for authentication. It looks like an email address (jsmith@contoso.com) but it is not necessarily the same as the user's email address. When users sign into the Azure portal or any Microsoft service, they authenticate with their UPN — the email address in Exchange may differ. This distinction becomes critical in hybrid environments.

Non-routable UPN suffixes in hybrid environments In many on-premises Active Directory deployments, the internal domain is non-routable: corp.local, contoso.internal. These cannot be used as UPNs in Entra ID because they are not verifiable internet domains. Before syncing users from on-prem AD, you must either add a routable UPN suffix (e.g. contoso.com) to the on-prem forest and update user accounts, or configure Alternate Login ID so users sign in with their email attribute instead of UPN. Failing to do this is one of the most common hybrid identity deployment mistakes.

On-premises sync: Entra Connect Sync

Microsoft Entra Connect Sync (formerly Azure AD Connect) is the agent installed on a domain-joined Windows Server that synchronises identities from on-prem Active Directory to Entra ID. Understanding the sync model is essential for hybrid environments.

Authentication MethodHow it worksWhen to use
Password Hash Sync (PHS) Hash of the password hash is synced to Entra ID. Auth happens in the cloud — no on-prem dependency for sign-in. Default and recommended for most organisations. Provides leaked credential detection via Identity Protection.
Pass-Through Authentication (PTA) Entra ID passes credentials to an on-prem PTA agent for validation. Password never leaves on-prem. Organisations with strict policy that passwords must not leave on-premises, but no ADFS infrastructure.
Federation (ADFS) Entra ID trusts an on-prem ADFS farm as the authentication authority. Entra ID defers auth entirely to ADFS. Complex claims requirements, smartcard auth, organisations already invested in ADFS. Highest complexity, highest risk of outage.
Cloud-only vs. synced accounts Cloud-only accounts are created directly in Entra ID and have no on-prem counterpart. Synced accounts originate in on-prem AD and are written to Entra ID by Connect Sync — certain attributes are mastered in AD and cannot be edited in the cloud (the portal will grey them out). This matters operationally: if you need to change a synced user's UPN, you must change it in on-prem AD and wait for the sync cycle, not in the Azure portal.

Groups: Security, Microsoft 365, and Dynamic Membership

Security groups vs. Microsoft 365 groups

PropertySecurity GroupMicrosoft 365 Group
PurposeRBAC role assignments, policy targeting, app assignments, group-based licensingCollaboration: shared mailbox, calendar, Teams, SharePoint site
Can be used for Azure RBAC?Yes — the primary group type for RBACYes — but only when the group is mail-enabled security type or the M365 group is used directly
Can contain guest users?YesYes
Can be nested in other groups?Yes — Azure RBAC respects nested group inheritanceNo — M365 groups cannot be nested
Dynamic membershipYes (requires P1)Yes (requires P1)

Assigned vs. Dynamic membership

Assigned membership means group members are added and removed manually by an administrator or group owner. Simple, but operationally expensive at scale.

Dynamic membership uses a rule expression to automatically add or remove users (or devices, for device groups) based on their Entra ID attributes. The group membership is continuously evaluated and updated — no manual intervention required.

Dynamic rule syntax examples:

# All Finance department members (not guests)
(user.department -eq "Finance") -and (user.userType -eq "Member")

# All users with a US usage location who have a job title containing "Engineer"
(user.usageLocation -eq "US") -and (user.jobTitle -contains "Engineer")

# All enabled accounts in the Sales department
(user.department -eq "Sales") -and (user.accountEnabled -eq true)

# Device rule: all Windows 10/11 devices enrolled via Intune
(device.deviceOSType -eq "Windows") -and (device.managementType -eq "MDM")
Dynamic groups require Entra ID P1 Dynamic membership rules are a Premium feature. If the P1 license expires or is removed, existing dynamic groups freeze — membership stops updating. Members at the time of license removal remain, but the rule stops being evaluated. This is a critical operational fact for cost management decisions.

Nested groups and Azure RBAC

Azure RBAC does evaluate nested group membership. If Group A is a member of Group B, and Group B has the Contributor role on a subscription, then users in Group A are effective Contributors on that subscription through transitive membership. This is the correct behaviour and differs from some other systems (e.g., on-prem AD RBAC evaluation varies by application).

Group-based licensing Security groups (including dynamic groups) can be used to assign Microsoft 365 and Entra ID licenses automatically. When a user joins a dynamic group that has a license assigned, they receive that license automatically. This is the scalable alternative to per-user license assignment in large organisations.

Service Principals: Application Identities

A service principal is an identity for an application or service in your Entra ID tenant. When an application needs to call Azure APIs, Microsoft Graph, or any Entra-protected resource, it authenticates as a service principal — not as a human user.

App Registration vs. Enterprise Application

This is one of the most confusing conceptual distinctions in Entra ID, and it appears on the exam:

📋 App Registration (the definition — lives in your tenant or a partner tenant) ↓ creates automatically 🏭 Enterprise Application / Service Principal (the instance — the identity used for auth)
ObjectWhat it isWhere it lives
App Registration The application definition — defines what the app is, what permissions it requests, redirect URIs, token lifetimes The tenant where the app is registered (the developer's tenant)
Enterprise Application (Service Principal) The instantiation of the app in a specific tenant — this is what is actually used for authentication and permission grants Every tenant where the app is consented to. A multi-tenant app has one App Registration but an Enterprise Application in every tenant that uses it.

Client credentials: secret vs. certificate

Credential TypeHow it worksProduction recommendation
Client Secret A generated string value, like a password. Sent directly in the token request. Has an expiry (max 24 months). Avoid in production. Secrets leak into logs, environment variables, and source code. Requires active rotation management.
Client Certificate The app signs the token request with a private key; Entra ID validates using the registered public key. The private key never leaves the application environment. Preferred when service principals must be used. Store the certificate in Azure Key Vault and use the Key Vault reference in your application.
Federated Credential (OIDC) No credential at all — an external identity provider's token (e.g. GitHub Actions OIDC token) is exchanged for an Entra ID access token via Workload Identity Federation. Best practice for CI/CD pipelines. Zero long-lived credentials. No rotation required.
Service principal secrets in source control A client secret committed to a Git repository, even briefly, should be treated as permanently compromised. Entra ID Workload Identity Federation (federated credentials) eliminates this risk entirely for CI/CD scenarios — use it whenever your pipeline supports OIDC token issuance (GitHub Actions, Azure DevOps, GitLab CI all support this natively).

Managed Identities: The Right Way to Authenticate Azure Resources

A managed identity is a service principal whose lifecycle and credentials are fully managed by Azure. You never see the credential. You cannot export it. Azure rotates it automatically. This eliminates the entire credential management problem.

System-assigned vs. User-assigned

PropertySystem-assignedUser-assigned
CreationEnabled directly on an Azure resource (VM, Function App, etc.)Created as a standalone Azure resource first, then assigned to one or more resources
LifecycleTied to the resource — deleted when the resource is deletedIndependent lifecycle — deleting the resource does not delete the identity
Scope of useOne resource only — cannot be sharedCan be assigned to multiple resources simultaneously
Entra ID objectCreates a service principal in the tenant, auto-deleted with resourceCreates a service principal in the tenant, persists until the managed identity resource is deleted
Best forSingle VM or App Service with a unique identity requirementMultiple resources sharing the same identity (e.g. a fleet of VMs needing Key Vault access)

How managed identity authentication works (IMDS)

When code running on an Azure resource (VM, App Service, Function App, AKS pod) needs an access token, it calls the Azure Instance Metadata Service (IMDS) — a non-routable REST endpoint available from within every Azure resource:

GET http://169.254.169.254/metadata/identity/oauth2/token
    ?api-version=2018-02-01
    &resource=https://vault.azure.net
    Metadata: true

IMDS returns an access token for the managed identity's service principal. The application uses this token to authenticate to Key Vault, Storage, or any other Entra-protected resource — with zero credentials in the application code or configuration.

Why managed identities are always preferred over service principals with secrets No credential to store. No credential to rotate. No credential to leak. No expiry to miss. The access token is scoped and short-lived. Entra ID handles the cryptographic key material entirely. In any design review, if you see a service principal with a client secret used where a managed identity would work, flag it as a finding.
Supported resources Managed identities are supported on VMs, Virtual Machine Scale Sets, App Service, Azure Functions, Logic Apps, Container Instances, AKS (workload identity), Service Bus consumers, and many more. Check the current support list — it grows with nearly every Azure release cycle.

Entra ID License Tiers and What Each Unlocks

Understanding the license tier gates is essential both for the exam and for production architecture decisions. Many governance features require Premium licensing.

FeatureFreeP1P2
User and group management
SSO (up to 10 apps)
MFA per-user (basic)
Dynamic group membership
Conditional Access policies
Group-based application assignment
Self-service password reset (hybrid)
Identity Protection (risky sign-in policies)
Privileged Identity Management (PIM)
Access Reviews
Entitlement Management
P2 is required for PIM — which is required for enterprise compliance Any enterprise environment handling sensitive workloads needs Privileged Identity Management. PIM provides just-in-time role activation, approval workflows, and audit trails for privileged access. It requires Entra ID P2 per privileged user. Budget accordingly — the cost of P2 is trivially small compared to the compliance, audit, and breach risk of permanent standing access.

Hands-On: Create, Inspect, and Assign Identities

Work through these steps in portal.azure.com. Use a non-production tenant or a Visual Studio subscription if available.

  1. Create a member user: Navigate to Microsoft Entra ID → Users → New user → Create new user. Set a UPN, display name, and temporary password. Note the UPN format — it uses your tenant's verified domain. Assign no roles.
  2. Create a dynamic security group: Go to Groups → New group. Select Security type and Dynamic User membership type. Add the rule: (user.department -eq "Engineering"). Save and observe that the member list shows "No members" until user department attributes are set — this is intentional and expected behaviour.
  3. Create an App Registration: Navigate to App registrations → New registration. Give it a name (e.g. app-demo-01). Accept defaults. After creation, note the Application (client) ID and Directory (tenant) ID. Go to Certificates & secrets → New client secret — add one with a short expiry. Then go to Enterprise applications and find the corresponding Enterprise Application that was auto-created. This is the service principal object.
  4. Assign a system-assigned managed identity to a VM: Open a VM → Security → Identity → System assigned. Toggle the Status to On and Save. Azure creates a service principal in Entra ID with the same name as the VM. Verify by going to Entra ID → Enterprise applications → All applications and searching for the VM name — the managed identity service principal will appear there.
  5. Grant the managed identity Key Vault access: Navigate to a Key Vault → Access control (IAM) → Add role assignment. Select Key Vault Secrets User. In the Members step, choose Managed identity and select your VM's identity. The VM can now read secrets from Key Vault using the IMDS endpoint — no stored credentials anywhere.
Checkpoint You should now be able to explain the difference between all four identity object types in Entra ID, know which license tier unlocks which governance features, and understand why managed identities should be the default choice for Azure resource authentication.

Check Your Understanding

Click any option to see immediate feedback. These questions reflect real exam reasoning and production decision-making.

1. A service running on a VM needs to read secrets from Azure Key Vault. What identity approach should you use?

Managed identity is always the correct answer when a resource on Azure needs to authenticate to another Azure service. There are no credentials to manage, rotate, or accidentally expose. The IMDS endpoint provides short-lived tokens on demand. Options A and D both involve credentials that must be managed, stored, and rotated. Option B is never acceptable for secrets. A user-assigned identity is preferred over system-assigned here because it can be pre-configured with the right RBAC before VM creation.

2. Your on-prem AD syncs users to Entra ID via Entra Connect. A user's UPN in on-prem AD is jsmith@corp.local (a non-routable domain). What must you configure for this user to sign into Azure?

Entra ID requires a verifiable (routable) domain for UPNs. A .local domain cannot be verified, so Entra Connect cannot sync the UPN as-is. The correct fix is to add a routable suffix (e.g. contoso.com) to the on-prem AD forest, update user UPNs in AD, and allow Connect to sync them — or enable Alternate Login ID so users authenticate with their email attribute. Creating shadow accounts (C) creates a management nightmare with two identities per person.

3. What is the fundamental difference between a system-assigned and user-assigned managed identity?

The lifecycle and shareability distinction is the core difference. System-assigned: enabled on a single resource, the service principal is deleted when the resource is deleted — simple but inflexible. User-assigned: a standalone resource in a resource group, can be pre-provisioned with RBAC, then assigned to multiple compute resources — the right choice at scale or when you want to pre-stage permissions before resource creation. Neither type requires P2 licensing.

4. You need to control Azure resource access for 500 developers using dynamic group membership based on their department attribute. What license tier is required?

Dynamic group membership is a P1 feature. Every user who will be managed by dynamic group rules (i.e., who could be a member) must have a P1 license assigned in the tenant. P2 is not required for dynamic groups alone — P2 is required for PIM, Identity Protection, and Access Reviews. M365 E3 includes Entra P1, but the feature requirement is P1, not specifically E3.

5. You register an application in Entra ID so it can call Microsoft Graph API. What objects are created in the tenant?

Registering an application always creates two objects: the App Registration (in your tenant's App registrations blade, defines scopes, redirect URIs, credentials) and an Enterprise Application (in Enterprise applications blade, which is the service principal — the actual identity used when the app authenticates). The Enterprise Application is auto-created in your tenant as soon as you complete the registration. Managed identities are for Azure resources, not for app registrations.

6. You want a CI/CD pipeline to authenticate to Azure without storing any long-lived credentials. What is the recommended approach in 2026?

Workload Identity Federation is the current best practice for CI/CD pipelines. GitHub Actions, Azure DevOps, and GitLab CI all issue OIDC tokens per job. You configure a federated credential on the App Registration that trusts tokens from your pipeline's OIDC issuer — no secret or certificate ever exists. Option B improves on plaintext secrets but still has a long-lived credential. Option C works only if your build agent is an Azure VM with that managed identity assigned — not always the case with hosted agents. Option D still requires a credential (the cert private key) to be retrievable.
Primary source for this lesson Overview of the user, group, and application objects — Microsoft Entra ID (Microsoft Learn)

Also read: Managed identities for Azure resources overview and Workload Identity Federation. These three articles cover 80% of the identity questions in AZ-104.

Questions for your teacher (the AI agent)
This lesson covered the identity object model. There is much more to explore — ask your teacher to go deeper on any of these:
  • Walk me through configuring Workload Identity Federation for a GitHub Actions pipeline end-to-end.
  • What happens to a synced user's attributes if the Entra Connect sync service goes offline for 3 days?
  • How does Entra ID B2B differ from B2C — and when would you use each for a partner access scenario?
  • Explain how Conditional Access policies interact with managed identities — can you apply CA to a managed identity?
Coming up: Lesson 03 — Role-Based Access Control (RBAC) You now know the four types of security principals in Entra ID. Next, we cover the mechanism that grants those principals permissions: RBAC. We will go deep on role definition structure, the critical Actions vs. DataActions distinction, custom roles, scope inheritance, and Privileged Identity Management — the control that turns permanent standing access into auditable just-in-time activation.