Search Tutorials


Top Azure Active Directory Interview Questions (2026) | JavaInuse

Top 20 Azure Active Directory (Entra ID) Interview Questions and Answers


  1. What is Azure Active Directory (Microsoft Entra ID)?
  2. What is the difference between Azure AD and on-premises Active Directory?
  3. What are the Azure AD editions and their features?
  4. What is Single Sign-On (SSO) in Azure AD?
  5. What is Multi-Factor Authentication (MFA)?
  6. What is Conditional Access in Azure AD?
  7. What are Service Principals and Managed Identities?
  8. What is Azure AD B2B and B2C?
  9. How does Azure AD Connect work?
  10. What are OAuth 2.0 and OpenID Connect?
  11. What is Privileged Identity Management (PIM)?
  12. What are Azure AD App Registrations?
  13. How do you implement RBAC in Azure?
  14. What is Identity Protection in Azure AD?
  15. What is Azure AD Domain Services?
  16. How do you secure APIs with Azure AD?
  17. What are Groups and Roles in Azure AD?
  18. What is Seamless SSO?
  19. How do you audit and monitor Azure AD?
  20. What are best practices for Azure AD security?

Microsoft Azure Interview Questions

Comprehensive interview questions for Azure cloud services and data engineering roles.

1. What is Azure Active Directory (Microsoft Entra ID)?

Azure Active Directory (now Microsoft Entra ID) is a cloud-based identity and access management service that helps organizations manage user identities and create intelligent access policies.

Key Capabilities:
- Identity Management: Users, groups, devices
- Authentication: MFA, passwordless, SSO
- Authorization: RBAC, Conditional Access
- Application Access: 3000+ pre-integrated apps
- Developer Platform: OAuth 2.0, OpenID Connect

Common Use Cases:
- Enterprise user management
- SaaS application access
- Secure API access
- B2B/B2C scenarios
- Device management with Intune

2. What is the difference between Azure AD and on-premises Active Directory?

AspectAzure ADOn-Premises AD
ProtocolREST APIs, OAuth, SAML, OIDCLDAP, Kerberos, NTLM
StructureFlat (no OU, GPO)Hierarchical (Forest, Domain, OU)
QueryMicrosoft Graph APILDAP queries
ManagementAzure Portal, PowerShellAD Users & Computers, GPO
AuthenticationModern (OAuth, SAML)Traditional (Kerberos)
FederationNative federation supportADFS required

Azure AD is NOT a replacement for on-premises AD:
- Different purposes and protocols
- Hybrid identity bridges both
- Azure AD DS provides legacy protocol support in cloud

3. What are the Azure AD editions and their features?

Azure AD Free:
- Basic user and group management
- SSO to 10 apps per user
- Basic security reports
- Included with Azure subscription

Azure AD Office 365 Apps:
- All Free features
- Unlimited SSO
- Self-service password reset (cloud)
- Company branding

Azure AD Premium P1:
- All O365 features
- Conditional Access
- Dynamic groups
- On-premises SSO via Application Proxy
- Self-service password reset for hybrid

Azure AD Premium P2:
- All P1 features
- Privileged Identity Management (PIM)
- Identity Protection
- Access Reviews
- Entitlement Management

4. What is Single Sign-On (SSO) in Azure AD?

SSO allows users to sign in once and access multiple applications without re-authentication.

SSO Methods:
1. Password-based SSO:
- Stores and replays credentials
- For apps without federation support

2. SAML SSO:
// SAML flow
1. User accesses app
2. App redirects to Azure AD
3. User authenticates
4. Azure AD issues SAML token
5. Token sent to app via browser POST
6. App validates and grants access

3. OpenID Connect SSO:
// OIDC flow - Modern apps
1. User accesses app
2. App redirects to /authorize endpoint
3. User authenticates
4. Authorization code returned
5. App exchanges code for tokens
6. Access granted with ID token

4. Linked SSO:
- Links to existing app sign-in page
- No federation

5. What is Multi-Factor Authentication (MFA)?

MFA requires two or more verification methods: something you know (password), something you have (phone), or something you are (biometric).

MFA Methods:
- Microsoft Authenticator app (push, TOTP)
- SMS/Voice call
- FIDO2 security keys
- Windows Hello for Business
- Hardware OATH tokens

MFA Policies:
// Per-user MFA (Legacy)
// Enable in Azure AD > Users > Per-user MFA

// Conditional Access (Recommended)
{
    "conditions": {
        "users": {"include": ["All"]},
        "applications": {"include": ["All"]}
    },
    "grantControls": {
        "operator": "OR",
        "builtInControls": ["mfa"]
    }
}

// Security Defaults (Basic)
// Enable in Azure AD > Properties > Security defaults

Best Practices:
- Use Conditional Access over per-user MFA
- Enable number matching
- Prefer passwordless over SMS
- Require MFA for admin roles




6. What is Conditional Access in Azure AD?

Conditional Access is Azure AD's zero-trust policy engine that evaluates signals to make access decisions.

Signals (Conditions):
- User/Group membership
- IP location/Named locations
- Device platform/state
- Application being accessed
- Risk level (requires P2)

Access Controls:
// Example: Require MFA for admins
{
    "displayName": "Require MFA for Admins",
    "state": "enabled",
    "conditions": {
        "users": {
            "includeRoles": [
                "62e90394-69f5-4237-9190-012177145e10"  // Global Admin
            ]
        },
        "applications": {"include": ["All"]}
    },
    "grantControls": {
        "operator": "OR",
        "builtInControls": ["mfa"]
    }
}

// Example: Block legacy authentication
{
    "displayName": "Block Legacy Auth",
    "conditions": {
        "users": {"include": ["All"]},
        "applications": {"include": ["All"]},
        "clientAppTypes": ["other", "exchangeActiveSync"]
    },
    "grantControls": {
        "operator": "OR",
        "builtInControls": ["block"]
    }
}

Common Policies:
- Require MFA for all users
- Block legacy authentication
- Require compliant devices
- Block high-risk sign-ins
- Require approved client apps

7. What are Service Principals and Managed Identities?

Service Principal:
A security identity used by applications or services to access Azure resources.

// Create service principal
az ad sp create-for-rbac --name "MyApp" --role contributor \
  --scopes /subscriptions/{sub}/resourceGroups/{rg}

// Output includes:
{
    "appId": "xxx",           // Client ID
    "displayName": "MyApp",
    "password": "xxx",        // Client Secret
    "tenant": "xxx"           // Tenant ID
}

// Authenticate with service principal
az login --service-principal --username {appId} --password {secret} --tenant {tenant}

Managed Identity:
Azure-managed service principal that eliminates credential management.

// System-assigned (tied to resource lifecycle)
az vm identity assign --name myVM --resource-group myRG

// User-assigned (independent lifecycle)
az identity create --name myIdentity --resource-group myRG
az vm identity assign --name myVM --resource-group myRG \
  --identities /subscriptions/{sub}/resourceGroups/myRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity

// Use in code (Python)
from azure.identity import DefaultAzureCredential
credential = DefaultAzureCredential()
# Automatically uses managed identity when running in Azure

8. What is Azure AD B2B and B2C?

AspectB2B (Business-to-Business)B2C (Business-to-Consumer)
UsersPartners, vendors, contractorsCustomers, consumers
ScaleThousandsMillions
Identity SourcePartner's Azure AD, socialSocial, local accounts
DirectorySame Azure AD tenantSeparate B2C tenant
CustomizationLimitedFully customizable
PricingMonthly active usersMonthly active users

B2B Invitation:
// Invite external user via Graph API
POST https://graph.microsoft.com/v1.0/invitations
{
    "invitedUserEmailAddress": "partner@contoso.com",
    "inviteRedirectUrl": "https://myapp.com",
    "sendInvitationMessage": true
}

B2C User Flow:
- Sign up/Sign in
- Password reset
- Profile editing
- Custom policies for complex scenarios

9. How does Azure AD Connect work?

Azure AD Connect synchronizes on-premises AD identities to Azure AD for hybrid identity scenarios.

Components:
- Sync Engine: Synchronizes identity data
- Password Hash Sync: Syncs password hashes
- Pass-through Auth: Validates passwords on-premises
- Federation: ADFS integration
- Health Agent: Monitoring

Authentication Options:
// 1. Password Hash Sync (Recommended)
- Password hashes synced to Azure AD
- Cloud authentication
- Seamless SSO capable
- Works if on-prem AD unavailable

// 2. Pass-through Authentication
- Passwords validated on-premises
- Agent on-premises required
- Real-time password validation
- Password policies enforced

// 3. Federation (ADFS)
- ADFS handles authentication
- Complex scenarios (smart cards)
- High availability required

Sync Rules:
- Users, groups, contacts
- Filtering by OU or attribute
- Attribute transformations
- Typically syncs every 30 minutes

10. What are OAuth 2.0 and OpenID Connect?

OAuth 2.0:
Authorization framework for delegated access to APIs.

OpenID Connect (OIDC):
Authentication layer built on top of OAuth 2.0.

// Authorization Code Flow (Web apps)
1. GET /authorize?client_id=xxx&response_type=code&redirect_uri=xxx&scope=openid profile
2. User authenticates
3. Redirect to callback with ?code=xxx
4. POST /token with code to get tokens

// Tokens received:
{
    "access_token": "xxx",    // For API access
    "id_token": "xxx",        // User identity (OIDC)
    "refresh_token": "xxx",   // Get new tokens
    "expires_in": 3600
}

// Client Credentials Flow (Service-to-service)
POST /token
grant_type=client_credentials
&client_id=xxx
&client_secret=xxx
&scope=https://graph.microsoft.com/.default

// Common Scopes
openid           // Required for OIDC
profile          // User profile info
email            // Email address
offline_access   // Refresh token
User.Read        // Microsoft Graph

11. What is Privileged Identity Management (PIM)?

PIM provides just-in-time privileged access to Azure AD and Azure resources, reducing the risk of standing admin access.

Key Features:
// Role assignment types:
1. Eligible - Must activate when needed
2. Active - Always active (not recommended)

// Activation settings:
{
    "maxDuration": "PT8H",           // Max 8 hours
    "requireMfa": true,
    "requireJustification": true,
    "requireApproval": true,
    "approvers": ["user@domain.com"]
}

// Activate role via PowerShell
$schedule = New-Object Microsoft.Open.MSGraph.Model.MsRoleAssignmentSchedule
$schedule.Duration = "PT4H"
New-MgRoleManagementDirectoryRoleAssignmentScheduleRequest `
    -PrincipalId $userId `
    -RoleDefinitionId $roleId `
    -DirectoryScopeId "/" `
    -Action "SelfActivate" `
    -ScheduleInfo $schedule `
    -Justification "Need to manage users"

PIM Capabilities:
- Azure AD roles (Global Admin, etc.)
- Azure resource roles (Owner, Contributor)
- Access reviews
- Alerts and notifications
- Audit history

12. What are Azure AD App Registrations?

App registrations define your application's identity in Azure AD for authentication and authorization.

// App registration components:
{
    "displayName": "My Application",
    "signInAudience": "AzureADMyOrg",  // Single tenant
    // Or "AzureADMultipleOrgs" for multi-tenant
    
    "web": {
        "redirectUris": ["https://myapp.com/callback"],
        "implicitGrantSettings": {
            "enableAccessTokenIssuance": false,
            "enableIdTokenIssuance": true
        }
    },
    
    "api": {
        "oauth2PermissionScopes": [{
            "id": "xxx",
            "value": "access_as_user",
            "adminConsentDisplayName": "Access API",
            "type": "User"
        }]
    },
    
    "requiredResourceAccess": [{
        "resourceAppId": "00000003-0000-0000-c000-000000000000",  // Graph
        "resourceAccess": [{
            "id": "e1fe6dd8-ba31-4d61-89e7-88639da4683d",  // User.Read
            "type": "Scope"
        }]
    }]
}

Key Concepts:
- Application ID (Client ID): Unique identifier
- Directory ID (Tenant ID): Azure AD tenant
- Client Secret/Certificate: Authentication credentials
- Redirect URIs: Where tokens are sent
- API Permissions: What app can access

13. How do you implement RBAC in Azure?

Azure Role-Based Access Control manages who has access to Azure resources.

// RBAC Components:
// 1. Security Principal (who)
// 2. Role Definition (what)
// 3. Scope (where)

// Built-in roles:
Owner              // Full access
Contributor        // All except access management
Reader             // View only
User Access Admin  // Manage user access

// Assign role via CLI
az role assignment create --assignee user@domain.com \
  --role "Contributor" \
  --scope /subscriptions/{sub}/resourceGroups/{rg}

// Custom role definition
{
    "Name": "Custom Reader Plus",
    "Description": "Can read and restart VMs",
    "Actions": [
        "*/read",
        "Microsoft.Compute/virtualMachines/restart/action"
    ],
    "NotActions": [],
    "AssignableScopes": ["/subscriptions/{sub}"]
}

// Create custom role
az role definition create --role-definition custom-role.json

Scope Hierarchy:
Management Group > Subscription > Resource Group > Resource
(Permissions inherit downward)

14. What is Identity Protection in Azure AD?

Identity Protection uses machine learning to detect and respond to identity-based risks.

Risk Types:
User Risk:
- Leaked credentials
- Unusual user behavior
- Compromised account patterns

Sign-in Risk:
- Anonymous IP address
- Atypical travel
- Malware-linked IP
- Unfamiliar sign-in properties

// Risk-based Conditional Access policy
{
    "displayName": "Block High Risk Sign-ins",
    "conditions": {
        "users": {"include": ["All"]},
        "applications": {"include": ["All"]},
        "signInRiskLevels": ["high"]
    },
    "grantControls": {
        "builtInControls": ["block"]
    }
}

// Self-remediation policy
{
    "displayName": "Require MFA for Medium Risk",
    "conditions": {
        "signInRiskLevels": ["medium"],
        "userRiskLevels": ["medium"]
    },
    "grantControls": {
        "builtInControls": ["mfa", "passwordChange"]
    }
}

15. What is Azure AD Domain Services?

Azure AD DS provides managed domain services (LDAP, Kerberos, NTLM, Group Policy) without deploying domain controllers.

Use Cases:
- Lift-and-shift legacy apps requiring AD
- Apps that can't use modern auth
- LDAP authentication needs
- Domain join Azure VMs

// Azure AD DS provides:
- Domain join for Azure VMs
- LDAP bind and search
- Kerberos authentication
- NTLM authentication
- Group Policy (limited)
- Password hash sync from Azure AD

// NOT included:
- Schema extensions
- Trust relationships
- Forest trusts
- FSMO role access

Architecture:
- Two domain controllers (HA)
- Managed by Microsoft
- Syncs from Azure AD
- Dedicated subnet required




16. How do you secure APIs with Azure AD?

// 1. Register API in Azure AD
// 2. Define API permissions (scopes)
// 3. Configure token validation

// ASP.NET Core API configuration
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
    .AddMicrosoftIdentityWebApi(Configuration.GetSection("AzureAd"));

// appsettings.json
{
    "AzureAd": {
        "Instance": "https://login.microsoftonline.com/",
        "Domain": "yourdomain.onmicrosoft.com",
        "TenantId": "your-tenant-id",
        "ClientId": "your-api-client-id",
        "Audience": "api://your-api-client-id"
    }
}

// Protect controller
[Authorize]
[RequiredScope("access_as_user")]
public class OrdersController : ControllerBase
{
    [HttpGet]
    public IActionResult Get()
    {
        var userId = User.FindFirst(ClaimTypes.NameIdentifier)?.Value;
        return Ok();
    }
}

Token Validation:
- Issuer (iss) - Your tenant
- Audience (aud) - Your API
- Expiration (exp) - Not expired
- Signature - Valid and trusted

17. What are Groups and Roles in Azure AD?

Groups:
// Group Types:
1. Security Groups - Access management
2. Microsoft 365 Groups - Collaboration

// Membership Types:
1. Assigned - Manual membership
2. Dynamic User - Rule-based
3. Dynamic Device - Rule-based (security only)

// Dynamic membership rule
user.department -eq "Sales" -and user.country -eq "US"

// Create dynamic group
{
    "displayName": "US Sales Team",
    "groupTypes": ["DynamicMembership"],
    "membershipRule": "user.department -eq 'Sales'",
    "membershipRuleProcessingState": "On"
}

Directory Roles:
// Built-in Azure AD roles:
Global Administrator      // Full access to Azure AD
User Administrator        // Manage users and groups
Application Administrator // Manage app registrations
Security Administrator    // Security settings
Billing Administrator     // Billing and subscriptions

// Assign role
az ad user update --id user@domain.com --append-roles "User Administrator"

18. What is Seamless SSO?

Seamless SSO automatically signs in users on corporate devices connected to the corporate network without password prompts.

How it Works:
1. User accesses cloud app from domain-joined device
2. Browser gets referred to Azure AD
3. Azure AD sends Kerberos challenge
4. Browser gets Kerberos ticket for Azure AD (AZUREADSSOACC account)
5. Ticket sent to Azure AD
6. Azure AD validates ticket, issues tokens
7. User signed in without password prompt

Requirements:
- Azure AD Connect with Password Hash Sync or Pass-through Auth
- Domain-joined devices
- Users on corporate network
- Modern browsers

Enable Seamless SSO:
- Configure in Azure AD Connect wizard
- Creates AZUREADSSOACC computer account in on-prem AD
- Update browser policies for trusted sites

19. How do you audit and monitor Azure AD?

1. Sign-in Logs:
// Query via Graph API
GET https://graph.microsoft.com/v1.0/auditLogs/signIns
?$filter=createdDateTime ge 2024-01-01 and status/errorCode ne 0

// Key fields:
- userPrincipalName
- appDisplayName
- ipAddress
- location
- status (success/failure)
- conditionalAccessPolicies

2. Audit Logs:
// Activities logged:
- User management (create, update, delete)
- Group management
- Application changes
- Role assignments
- Policy changes

// Query
GET https://graph.microsoft.com/v1.0/auditLogs/directoryAudits
?$filter=activityDisplayName eq 'Add member to role'

3. Log Analytics Integration:
// Send logs to Log Analytics workspace
// Azure AD > Diagnostic settings > Add diagnostic setting

// KQL query for failed sign-ins
SigninLogs
| where ResultType != "0"
| summarize count() by UserPrincipalName, ResultDescription
| order by count_ desc

// Alert on impossible travel
SigninLogs
| where RiskDetail == "ImpossibleTravel"

20. What are best practices for Azure AD security?

1. Identity Protection:
- Enable Security Defaults (minimum)
- Use Conditional Access (recommended)
- Implement MFA for all users
- Block legacy authentication

2. Privileged Access:
// Best practices:
- Minimize Global Administrators (< 5)
- Use PIM for just-in-time access
- Require MFA for admin roles
- Use emergency access accounts (break glass)
- Review role assignments regularly

3. Application Security:
- Implement consent policies
- Review app permissions regularly
- Use certificates over secrets
- Rotate credentials

4. Monitoring:
- Enable sign-in and audit logs
- Set up alerts for suspicious activities
- Review Identity Protection reports
- Conduct access reviews

5. Zero Trust Principles:
// Implement zero trust:
1. Verify explicitly - Always authenticate and authorize
2. Least privilege - Just-in-time, just-enough access
3. Assume breach - Minimize blast radius

// Conditional Access policies:
- Require compliant devices
- Block risky sign-ins
- Enforce app protection policies
- Use session controls

6. Hybrid Security:
- Protect AD Connect server
- Enable Password Hash Sync for resilience
- Monitor synchronization health
- Implement seamless SSO

Microsoft Azure Interview Questions

Comprehensive interview questions for Azure cloud services and data engineering roles.


Popular Posts