D1 · Identity and Access

Conditional Access

IF-THEN policies that evaluate context signals and apply access controls. The AZ-104 tests policy configuration, named locations, risk conditions, and session controls.

Icon-identity-233

Conditional Access — the access decision engine

is the IF-THEN policy engine of . It evaluates context signals (who they are, where they're coming from, which device, which app, what risk level) and decides whether to allow, block, or add additional controls (MFA, compliant device, etc.).

Requires Entra ID P1 at minimum. For risk signals (Identity Protection) it requires P2.

Policy examples — IF → THEN logic

IF User is Global Admin + login from any location
THEN Require MFA always
IF Login from an IP outside trusted Named Locations
THEN Require MFA
IF Login from a NON-compliant device (Intune) to M365 apps
THEN Block access
IF Sign-in risk = High (Identity Protection)
THEN Require MFA + password change
IF App = Microsoft Azure Management (portal, CLI, PowerShell)
THEN Require compliant device + MFA
IF Login with a legacy protocol (IMAP, basic SMTP, MAPI)
THEN Block access — they don't support MFA
IF User in the "External Partners" group accesses SharePoint
THEN Allow + sign-in frequency: 1 hour

Available signals (Conditions)

Users / Groups

Who the policy applies to. Include: everyone, specific groups, directory roles. Exclude: break-glass accounts, service accounts.

Cloud apps / Actions

Which apps it applies to. All apps, a specific selection (e.g., Salesforce), or user actions (e.g., registering a device).

Locations

Based on IP. Named Locations (trusted IP ranges) or countries/regions. "Any location" vs "All trusted locations" vs specific locations.

Device platforms

Operating system: Windows, macOS, iOS, Android, Linux. Useful for treating mobile differently from desktop.

Client apps

Client type: Browser (modern), Mobile/Desktop apps, Exchange ActiveSync (legacy), Other clients (legacy). Useful for blocking legacy authentication.

Sign-in risk (P2)

Risk score computed by Identity Protection: Low, Medium, High. Based on ML: login from a new country, Tor, credential spray, etc.

User risk (P2)

Cumulative risk for the user: leaked credentials, historical anomalous behavior. Low/Medium/High.

Device compliance / Hybrid join

Device status in Intune (compliant) or whether it's joined to on-prem AD DS (Hybrid Azure AD join). Requires Intune or Entra Connect.

Access controls

Grant controls

What to do if the condition is met. Can be combined with AND or OR.

Block access

Denies access completely. The user sees an access error.

Require MFA

The user must complete MFA to gain access.

Require compliant device

The device must be marked compliant in Intune.

Require Hybrid Azure AD join

The device must be joined to on-prem AD DS via Entra Connect.

Require approved client app

Only Intune-managed apps or specific Microsoft apps.

Require authentication strength

Specify a minimum level (e.g., passwordless, phishing-resistant).

Session controls

Control the behavior within the session (not the initial access).

Sign-in frequency

How often the user must re-authenticate. E.g., "1 hour" for sensitive apps. Replaces the fixed token lifetime.

Persistent browser session

"Never persistent" — the browser doesn't remember the session. Useful on shared devices.

App-enforced restrictions

Exchange Online and SharePoint only: controls within the app (no download, no copy, read-only).

Conditional Access App Control (MCAS)

Microsoft Defender for Cloud Apps proxy for real-time inspection of session content.

Disable resilience defaults

If Entra ID has an outage, don't allow access with cached tokens. Maximum security, lower resiliency.

Named Locations

Define trusted IP ranges (offices, corporate VPN) or geographic locations to use as conditions in CA policies.

IP ranges (IPv4 / IPv6)

Entra ID → Security → Named locations → New location → IP ranges.

NameLATAM Corporate Offices
Mark as trustedYes → shows up as a "trusted location" in conditions
IP ranges203.0.113.0/24, 198.51.100.0/24 (IPv4 CIDR)

Maximum of 2,000 Named Locations per tenant. Each with up to 2,000 IP ranges.

Countries location

Group countries for geographic policies. Useful for blocking logins from unexpected countries.

• Select one or more countries/regions

• Based on the GeoIP of the login's IP address

• Case: blocking employee access from countries where the company has no operations

• Limitation: VPN or proxy IPs can bypass geographic detection

Exam gotcha: "All trusted locations" in a CA policy only includes Named Locations marked as "Mark as trusted location" — not all Named Locations.

Identity Protection — risk signals (P2)

Microsoft analyzes billions of signals daily to detect suspicious logins. Requires Entra ID P2.

Sign-in risk

The probability that a specific login isn't legitimate. Calculated in real time.

LowMinor unfamiliar properties
MediumAnonymous IP (Tor), atypical properties
HighCredential spray, password spray, impossible travel (2 countries at once), malware-linked IP

User risk

The probability that the user's identity is compromised. Cumulative.

LowSlightly unusual login patterns
MediumCombined unusual activity
HighLeaked credentials (HIBP, dark web), impossible travel, malware activity

CA for Workload Identities — Service Principals and MIs

Conditional Access doesn't just apply to human users. It can also apply to Workload Identities (service principals and ). Requires the Entra ID Workload Identities Premium license.

Conditions available for Workload Identities

Service principal risk

Entra ID Identity Protection computes a risk score for the SP based on anomalous behavior, use of compromised IPs, etc.

IP location (Named Locations)

Restrict the SP to calling Azure only from specific IP ranges. Useful for apps that should only run from corporate or Azure IPs.

Real case: You have a Service Principal used in your CI/CD pipeline that should only call Azure Resource Manager. If someone steals the Client Secret and uses it from an external IP, the CA policy blocks access because the IP isn't in the allowed Named Locations.

Configuring CA for a Service Principal

1.Entra ID → Security → Conditional Access → New policy
2.Assignments → Users or workload identities → Workload identities
3.Select: All service principals or specific ones
4.Conditions → Locations → Include: Any location, Exclude: Trusted locations (corporate IPs)
5.Access controls → Grant: Block access
6.Enable the policy in Report-only mode first to verify impact
Icon-identity-233

Authentication Context — step-up auth

Authentication Context lets you apply additional CA controls to specific actions within an application, not just at initial login. It implements "step-up authentication."

Scenario: banking app

Initial login (normal CA policy)

The user signs in → requires standard MFA → accesses their balance and transactions.

Sensitive action: transferring money

The app flags this action with a "transfer-funds" Authentication Context. The CA policy for that context requires re-authentication with phishing-resistant MFA.

The user must re-authenticate with their FIDO2 key just for the transfer, even though they're already authenticated in the app.

Configuration

1.Entra ID → Security → Conditional Access → Authentication context → New authentication context
2.Create the context (e.g., "c1" named "High-value transaction")
3.Create a CA policy → Cloud apps: select specific apps → Authentication context: c1
4.Access controls → Grant: Require phishing-resistant MFA
5.The app includes the claim "acrs": "c1" in its token request when the user performs the sensitive action
6.Entra ID evaluates the CA policy for that context and requires the configured auth level

Note: The app must support Authentication Context — it needs to call Entra ID with the correct parameter. Requires implementation in the app's code.

CA for device registration

You can control which users can register or join devices to Entra ID using CA policies or direct restrictions.

Registration restriction

Entra ID → Devices → Device settings

"Users may register their devices" → All / Selected / None. If Selected: only the configured group can register.

Preventing users from registering personal BYOD devices without prior authorization.

CA policy for User Actions

CA policy → Cloud apps or actions → User actions

"Register or join devices" as the trigger. Apply conditions: require MFA, require compliant device to be able to register a new one.

Requiring MFA when someone registers a new device to prevent unauthorized registration.

Intune enrollment restrictions

Intune → Devices → Enrollment → Enrollment restrictions

Limit which platforms (iOS, Android, Windows) can enroll in Intune. Limit the number of devices per user.

Granular control of MDM enrollment beyond Entra ID registration.

Icon-identity-235

Best practices and common mistakes

✓ Best practices

  • →Use Report-only mode before enabling any policy in production.
  • →Always exclude break-glass accounts from ALL CA policies.
  • →Name policies with a clear convention: [Scope]-[Condition]-[Action], e.g., "ADMINS-AnyLocation-RequireMFA".
  • →Start with a limited scope (pilot group) and expand gradually.
  • →Review sign-in logs after enabling — look for unintended impact.
  • →Combine multiple controls with "Require one of the selected controls" to balance security/UX.

✗ Mistakes that cause lockouts

  • →Creating a "Block all" policy without excluding admins → everyone gets locked out, including the creator.
  • →Not excluding break-glass accounts → if there's an MFA issue, no one can get in.
  • →Requiring a "compliant device" for everyone without Intune configured → legitimate users get blocked.
  • →Enabling a policy without testing in Report-only → unexpected impact in production.
  • →Not accounting for service accounts and automations that fail with MFA.
  • →Mixing Per-User MFA with Conditional Access → unexpected behaviors.

Did you get this topic?

Test what you just learned

Which Conditional Access condition lets you block sign-ins from countries where the company doesn't operate?

Ready to test "Conditional Access"?

Put what you learned to the test with original AZ-104 exam questions.

Start AZ-104 mock exam

Unlimited mock exams with the Pro plan

Log in to track your progress.