AD to Azure AD Migration — What Happens Behind the Scenes

AD to Azure AD Migration — What Happens Behind the Scenes

Moving from classic AD to Azure Active Directory (Azure AD) is like stepping onto a bridge from a well-known territory into an expansive world of identity. Depending on the specifics, with enough effort and time (and a little luck), most migrations are possible to do successfully.

But everyone who’s ever been through an AD to Azure AD migration knows — there’s a lot more going on behind the scenes. The directory isn’t just “moved,” it is updated. Identity traits change, authentication flows transform and your on-premises world slips away quietly, leaving it to a cloud-first engine.

If you’ve been building and running IT environments for 10 or more years, you watched identity management move from password policies and domain joins to SSO, conditional access, MFA and automation. This article demystifies what really happens in that move — what Azure AD Connect does, how the PHS (Password Hash Sync) process works, what’s going on with identity propagation and why sometimes the migration process is more complicated than envisioned.

So let’s peel it all back, layer by layer.


1. The Core Idea: Synchronizing, Not Replacing

A common misconception is that Azure AD “inherits” everything from on-prem AD. What actually happens is:

  • Azure AD becomes the primary identity system for cloud apps
  • On-prem AD remains the authority for traditional workloads (unless you go fully cloud)
  • Azure AD Connect acts as the translator and traffic controller

Azure AD never replicates your domain controller or Group Policy. It takes only the necessary identity attributes and turns them into cloud-friendly objects. That’s why an AD object with 100+ attributes may result in a much smaller, normalized representation in Azure AD.

Behind the scenes, the sync engine is mapping, filtering, transforming, and normalizing these identities—even if all you see is a green “synchronized” badge in the portal.


2. Azure AD Connect: The Real Workhorse Behind the Migration

When preparing for an ad to azure ad migration, Azure AD Connect is the central engine running the entire backstage operation. It handles:

  • Attribute mapping (e.g., sAMAccountName → userPrincipalName)
  • Object filtering (domains, OUs, or attribute rules)
  • Identity joins (match existing cloud users with AD users)
  • Password sync and authentication mode setup
  • Writeback features (groups, devices, passwords)

What feels like a simple wizard is actually a pipeline of tasks happening in sequence:

  1. Import from AD
    Pulls the relevant objects (users, groups, contacts) into a connector space.
  2. Sync rules evaluation
    Applies precedence-based inbound/outbound rules that determine how an object should behave and what data it should carry.
  3. Provisioning into Azure AD
    Creates, joins, or updates cloud objects.
  4. Export
    Finalizes updates into the Azure AD tenant.

Every one of these stages is logged, controlled, and customizable. At scale, this is often where migrations get interesting—especially if identity conflicts appear.


3. Identity Matching: Where Things Get Risky

Azure AD Connect tries to avoid duplicate user creation. It uses a very specific matching logic:

  • Primary match: Immutable ID ↔ SourceAnchor
  • Secondary match: UserPrincipalName
  • Fallback: SMTP address (in limited scenarios)

If a company has been using Azure AD (via Microsoft 365) long before setting up sync, it’s common to find that users already exist in the cloud.

This is where behind-the-scenes magic saves you:

  • Azure AD Connect detects existing objects
  • It tries to auto-join them based on the matching rules
  • If mismatched, you might see “duplicate attribute” errors

This step often requires a clean-up because drift between AD and Azure AD is extremely common. Minor UPN differences, proxy addresses, and old identity formats can break sync until aligned.


4. The PHS Process: How Password Hash Sync Actually Works

Password Hash Sync (PHS) is one of the most misunderstood parts of migration. A lot of people assume PHS means “Microsoft stores your password,” which is not accurate.

Here’s what actually happens:

  1. The AD password hash (already a one-way hash) is taken from the domain controller.
  2. Azure AD Connect applies an additional hashing and salting process using SHA-256.
  3. The re-hashed value—not the original hash—is sent to Azure AD.
  4. Azure AD uses that hash to authenticate users against cloud services.

It’s important to understand:

  • Azure AD never receives the original AD hash.
  • Azure AD cannot derive the password from the hash—it’s mathematically infeasible.
  • The PHS process runs every 2 minutes by design.

This setup allows Azure AD to authenticate users directly. Once this happens, the dependency on on-prem infrastructure is drastically reduced compared to federated models.

Behind the scenes, this is what enables:

  • Seamless sign-in to SaaS applications
  • High availability authentication
  • Better integration with Conditional Access
  • Password protection features in Azure AD

In real-world terms, PHS simplifies the stack without compromising control.


5. UPN Normalization & Renaming: A Quiet But Critical Step

Most organizations realize mid-migration that their UPNs don’t match email addresses, or worse—aren’t routable.

Azure AD requires:

  • A routable suffix (e.g., @company.com)
  • Consistent identity format
  • No unsupported characters or naming conventions

So Azure AD Connect often ends up rewriting:

  • UPN suffixes
  • Proxy addresses
  • Display names
  • Immutable ID assignments

Although these changes look harmless, they influence:

  • SSO behavior
  • Microsoft 365 access
  • Conditional Access policies
  • Application authentication

This is one of those behind-the-scenes touches that can make or break a smooth migration.


6. Authentication Mode Shift: Where Identity Starts Living in the Cloud

During AD to Azure AD migration, you have to choose one of three authentication models:

1. Password Hash Sync (PHS)

The simplest and most widely recommended.

2. Pass-Through Authentication (PTA)

On-prem agent directly validates the password in real time.

3. Federation (AD FS)

The old-school method, now mostly used for niche compliance cases.

What you don’t see is how each model changes the authentication flow:

  • Sign-in tokens
  • Where MFA is triggered
  • Which directory validates credentials
  • How failover works
  • Where policy enforcement lives

Most migrations move toward PHS simply because it removes dependency on on-prem servers. Azure AD takes the brunt of the authentication load, leaving AD to handle only domain-joined devices and legacy authentication pathways.


7. Attribute Clean-Up: The “Silent” Part of Migration

Azure AD rejects incomplete or non-compliant data. So behind the scenes, Azure AD Connect is constantly checking:

  • Are attributes within size limits?
  • Are there illegal characters?
  • Does a proxyAddress value conflict with another user?
  • Is the UPN already used?
  • Are required attributes missing?

This clean-up phase is often the longest part of the migration. Most issues don’t show up until sync starts, and then the logs begin to surface details you didn’t even know were problems.


8. Group, Device & Password Writeback: Hybrid Identity Gets Its Superpowers

Once the migration stabilizes, optional features begin to make hybrid identity work in both directions:

  • Group Writeback brings Azure AD groups into AD.
  • Device Writeback lets Azure AD-registered devices authenticate against on-prem applications.
  • Password Writeback allows users to reset passwords in the cloud and sync them to AD.

These features are often overlooked but are crucial for a true hybrid model where cloud and on-prem identities cooperate instead of competing.


9. Cutover: When Azure AD Takes Center Stage

The final stage of migration isn’t about sync—it’s about shifting dependency:

  • VPN authentication starts hitting Azure AD
  • SaaS apps fully rely on cloud identity
  • Conditional Access governs access hygiene
  • Password resets move to self-service
  • Legacy authentication is phased out
  • MFA becomes the new normal

Behind the scenes, Azure AD becomes the primary orchestrator for identity, risk, compliance, and access control. At this point, the migration “feels complete,” even though the real heavy lifting was invisible.


10. Why Behind-the-Scenes Understanding Matters

Most problems during an AD to Azure AD migration don’t arise from the visible work—they come from:

  • Attribute mismatches
  • Incorrect UPN formats
  • Broken joins
  • Inconsistent passwords
  • Misconfigured sync rules
  • Unsupported federation features
  • Drift in multiple domains
  • Legacy apps that depend on old authentication models

Knowing how the engine works behind the scenes makes troubleshooting exponentially easier. Migrations fail not because the tools are complex, but because identity data has history… and history isn’t always clean.


Conclusion

An AD to Azure AD migration is not just a sync—it’s a rearchitecture of identity. Under the hood, Azure AD Connect is rewriting attributes, hashing passwords, matching objects, enforcing rules, and modernizing authentication patterns.

Understanding the behind-the-scenes processes—especially the PHS process, identity matching, attribute normalization, and authentication flow changes—gives you clarity and control during the transition.

Once the migration settles, you’re left with a hybrid identity setup that’s cleaner, more resilient, and aligned with the demands of modern cloud environments.