Azure Delta Sync is a game-changer for data replication and synchronization. It allows you to replicate only the changes made to your data, reducing the amount of data transferred and processed.
This approach is particularly useful for large datasets, as it significantly reduces the time and resources required for replication. Azure Delta Sync is designed to work with various data sources, including Azure Blob Storage, Azure Files, and Azure Data Lake Storage.
By using Azure Delta Sync, you can minimize data transfer costs and ensure that your data remains up-to-date across different locations. This is especially important for businesses with distributed teams and applications that require real-time data access.
Prerequisites
To get started with Azure delta sync, you'll need to meet some prerequisites.
First and foremost, you'll need an Azure AD tenant, which you can register for free if you don't have one already.
You'll also need an on-premises Active Directory environment that's already configured with the latest Azure AD Connect. In this tutorial, we're using a Windows Server 2019 Datacenter with Azure AD Connect 2.1.15.0.
Make sure you've installed the MSOnline PowerShell module on your Azure AD Connect server, as this tutorial assumes you have version 1.1.183.66 installed.
Note that the MSOnline and ADSync modules are not compatible with PowerShell Core, so for best results, use Windows PowerShell 5.1.
Here's a quick rundown of the prerequisites:
- An Azure AD tenant (register for free if you don't have one)
- A Windows Server 2019 Datacenter with Azure AD Connect 2.1.15.0
- MSOnline PowerShell module version 1.1.183.66 installed
- Windows PowerShell 5.1 (not PowerShell Core)
Also keep in mind that the synchronization cycle status, SyncCycleInProgress, will indicate whether the synchronization cycle is in progress.
Configuring Azure Delta Sync
To force an Azure AD Delta Sync, you can run the command Start-AdSyncSyncCycle on the server where the Azure AD Connect tool is installed.
The command can be run remotely using PowerShell, eliminating the need to log in to the server.
If a sync is already running, you'll get an error message indicating that the command needs to be run on the server where the Azure AD Connect tool is installed.
Delta sync is particularly useful for speeding up synchronization to Microsoft 365, such as when creating a new user and assigning a license.
Troubleshooting and Forcing Sync
Troubleshooting and Forcing Sync can be a challenge, but there are a few things to keep in mind. If you're getting an error that says "The Start-AdSyncSyncCycle command needs to be run on the server where the Azure AD Connect tool is installed", you'll need to run the cmdlet on the server where Azure AD Connect is installed.
If you're running the Start-AdSyncSyncCycle cmdlet and getting the error "If there is already a sync running you will get the following error", it means another synchronization is already in progress. In this case, you'll just need to wait for the current sync to finish.
To force a delta sync using the ADSync PowerShell, you can run the command "Start-ADSyncSyncCycle -PolicyType Delta." However, if the Azure AD Connect application is open, you'll get an error saying "synchronization cannot run." To resolve this, you can run the command "Stop-Process -Name AzureADConnect" to force-close the Azure AD Connect process.
Here are some possible errors you might encounter when forcing a delta sync:
- The Start-AdSyncSyncCycle command needs to be run on the server where the Azure AD Connect tool is installed.
- Another synchronization is already in progress.
- The Azure AD Connect application is open, preventing synchronization.
If you're experiencing any of these errors, try restarting the Azure AD Connect service or closing the application to resolve the issue.
Check Module
To check if the ADSync module is loaded, run the command below. If it's not loaded, you can use another command to import it.
The command to verify the module is loaded is the same as the one used to import it if it's not loaded. This assumes Azure AD Connect was installed to the default path.
You can verify the module is loaded by running the command below. If you run this on the machine with Azure AD Connect installed, you most likely don't need to import the module.
Forcing with PowerShell
Forcing with PowerShell is a powerful way to troubleshoot and force a sync. You can do this by running the Start-ADSyncSyncCycle cmdlet.
To run this cmdlet, you need to have the ADSync PowerShell module loaded. You can verify if the module is loaded by running the command Get-Module -ListAvailable | Where-Object {$_.Name -eq "ADSync"}.
If the module is not loaded, you can import it by running the command Import-Module -Name "C:\Program Files\Microsoft Azure AD Connect\Sync\bin\ADSync.psd1". If you installed Azure AD Connect to the default path, you can omit the path and just use the name "ADSync".
Once the module is loaded, you can run the Start-ADSyncSyncCycle cmdlet with the -PolicyType Delta parameter to force a delta sync.
Here are the steps to run the cmdlet:
1. Open PowerShell and run the command Get-Module -ListAvailable | Where-Object {$_.Name -eq "ADSync"} to verify if the module is loaded.
2. If the module is not loaded, run the command Import-Module -Name "ADSync" to import it.
3. Run the command Start-ADSyncSyncCycle -PolicyType Delta to force a delta sync.
Note that if there is already a sync running, you will get an error message. In this case, you can run the command Get-ADSyncSyncCycle to check the status of the sync.
Authorized Access
To access the Azure Delta Sync tool, you'll need to be part of the right group. By default, only the user who installed it and local admins on the machine can use and manage the sync engine.
The user who installed the tool and local admins are automatically granted access, but you can add other users to the ADSyncAdmins group on the local server to give them permission.
Installation and Setup
To set up Azure Delta Sync, you'll need to develop a thorough installation plan. This involves considering where and how you install the software, similar to Azure AD Connect.
You should install Azure Delta Sync on an infrastructure that you consider secure, with the same level of security concerns as your domain controller assets. This will help protect against potential security risks.
It's essential to monitor and maintain the software, as updates are released when security issues are identified.
Installation Plan
Develop a thorough installation plan by considering where and how you install Azure AD Connect cloud sync software. It should be installed on an infrastructure with the same security concerns as your domain controller assets.
You'll want to monitor and maintain the software, as it gets updated when security issues are identified. Be aware of any new research on potential security risks, such as recent research regarding potential man-in-the-middle attacks.
To ensure a smooth installation, plan for the software to run a delta sync at least once every 7 days. This is a Microsoft recommendation to avoid issues that can only be resolved by a full sync, which can be very time-consuming.
Here's a brief summary of the sync cycle requirements:
By following these guidelines and considering the sync cycle requirements, you'll be well on your way to a successful Azure AD Connect cloud sync installation.
New Option
Microsoft now offers another synchronization tool: Azure AD Connect cloud sync. This option allows you to deploy a lightweight agent in both your on-premises and IaaS-hosted environments.
You manage its configuration in Azure AD, which simplifies the setup process. Azure AD Connect cloud sync is a great option for companies that need to synchronize from a multi-forest disconnected Active Directory environment.
This is particularly useful in merger & acquisition scenarios. The tool also supports using multiple provisioning agents, which can simplify high availability environments.
However, keep in mind that Azure AD Connect cloud sync does not support writeback or synchronization of customer-defined AD attributes. If you need these features, you may want to consider using Azure AD Connect instead.
Understanding Azure Delta Sync
Azure Delta Sync is a powerful tool that helps synchronize changes between your on-premises Active Directory and Azure AD.
It can be triggered manually by running the Start-AdSyncSyncCycle cmdlet on the server where the Azure AD Connect tool is installed.
This cmdlet can be run remotely using PowerShell, eliminating the need to physically access the server.
Azure Delta Sync is particularly useful when creating new users in your Active Directory, allowing you to speed up synchronization to Microsoft 365 and assign licenses quickly.
By default, the sync is one-way, from on-premises AD to Azure AD, but you can configure the writeback function to sync changes from Azure AD back to your on-premises AD.
How It Works
Azure Delta Sync is a powerful tool that synchronizes data between your on-premises Active Directory and Azure Active Directory. You install the application on a domain-joined server in your on-premises data center.
The default installation option is Express Settings, which is ideal for synchronizing data between a single on-premises forest with one or more domains and a single Azure AD tenant.
By default, the sync is one way: from on-premises AD to Azure AD. This means that any changes made to user accounts or other data in your on-premises AD will be synced to Azure AD, but not the other way around.
However, you can configure the writeback function to sync changes from Azure AD back to your on-premises AD. This is useful for scenarios where users need to update their passwords using the Azure AD self-service password management function.
How Often Is Data
Data synchronization with Azure Delta Sync is quite flexible. By default, a sync task runs every 30 minutes.
You can review the scheduler’s configuration to change some of its parameters. This will allow you to customize the synchronization frequency to suit your needs.
A sync task can be forced to run immediately, which is useful if you need to update data urgently.
You can also stop a running sync task or temporarily disable the scheduler, for example, to modify the configuration of Azure AD Connect.
Active Directory and Storage
Active Directory and Storage is a crucial aspect of Azure Delta Sync. Azure Delta Sync supports integration with Azure Active Directory (Azure AD) for authentication and authorization.
To enable this integration, you need to configure Azure AD as the identity provider for your Azure Delta Sync environment. This involves setting up an Azure AD application and granting the necessary permissions.
With Azure Delta Sync, you can also store your configuration and sync history in Azure Blob Storage or Azure File Storage. This allows you to scale your sync environment and take advantage of Azure's built-in storage features.
Active Directory
Active Directory is a bit of a confusing topic, especially with Microsoft's naming changes.
Azure Active Directory sync is a tool that ensures your usernames and passwords match up between on-premises servers and cloud services.
It refers to two different Microsoft identity management tools: Azure AD connect sync and Azure AD Connect cloud sync.
This synchronization software is essential for connecting your workstations to cloud services.
Microsoft Entra ID is NOT the same as Active Directory, and the name change aims to create a clearer distinction between the two platforms.
The naming change may cause some initial confusion, but it's a step towards a better understanding of the different tools and services.
Cloud vs. Local Storage
Azure AD Connect cloud sync is a newer technology that connects your resources to the cloud, using the Azure AD cloud provisioning agent, which is less impactful on your network and better for performance.
This means you can expect faster and more efficient syncing, which is especially beneficial for large organizations with complex networks.
The cloud sync technology is set to become the de-facto synchronization tool, once its feature set is comparable to the older Azure AD Connect sync.
Running and Managing Sync
You can force the synchronization using the Synchronization Service Manager, which is automatically installed with Azure AD Connect. This tool allows you to troubleshoot synchronization errors and manually start and stop the synchronization.
To use the Synchronization Service Manager, follow these steps: open the Start Menu, select Synchronization Service (located under Azure AD Connect), click on Connectors, select the local connector, and then click on Run in the sidebar. Choose Delta Synchronization and click Ok.
Azure AD Connect cloud sync is designed for smaller organizations and requires fewer resources in terms of server specifications. It's anticipated to replace Azure AD Connect sync, but currently, it's not suitable for large organizations.
You can inspect the current delta sync schedule by importing the ADSync module into your PowerShell session. Then, run the cmdlet below to display the current sync schedule. The output will show the sync interval, which is every 30 minutes by default.
Microsoft recommends that a sync must run at least once every 7 days, as follows: a delta sync must happen within 7 days from the last delta sync, and a delta sync (following a full sync) must occur within 7 days from the time the last full sync completed. Failure to follow these recommendations can result in issues that can be resolved only by a full sync.
Running with
Running with Azure AD Connect sync requires some careful consideration. You can change the default schedule of every 30 minutes to something else, but there's an upper and lower limit to the interval - it needs to run at least once per 7 days and can't run more than once per 30 minutes.
To change the schedule, you'll need to use the Set-ADSyncScheduler cmdlet, and after that, you'll need to run a delta sync for the new schedule to take effect. This is a crucial step, as it ensures that your changes are properly applied.
Microsoft recommends that a delta sync must happen within 7 days from the last delta sync, and a delta sync following a full sync must occur within 7 days from the time the last full sync completed. Failing to follow these recommendations can result in issues that can only be resolved by a full sync, which can be very time-consuming.
Here are some key properties to keep in mind when inspecting the current delta sync schedule:
- AllowedSyncCycleInterval – The minimum interval allowed between (scheduled) synchronization cycles.
- CurrentlyEffectiveSyncCycleInterval – The current sync cycle interval in effect.
- CustomizedSyncCycleInterval – The customized sync interval.
- NextSyncCycleStartTimeInUTC – Shows when's the next scheduled sync.
Running
If you're not a fan of PowerShell, you can still force synchronization using the Synchronization Service Manager.
This tool is automatically installed with Azure AD Connect and lets you troubleshoot synchronization errors and manually start and stop the synchronization. To access it, open the Start Menu and look for Synchronization Service (located under Azure AD Connect).
To run a delta synchronization, click on Connectors, select the local connector, and then click on Run in the sidebar. From there, choose Delta Synchronization and click Ok.
Azure AD Connect cloud sync is the newer sync platform, but it's currently designed for smaller organizations and requires fewer resources in terms of server specifications.
Frequently Asked Questions
What is the sync cycle for Azure AD Connect Delta?
The Delta Sync cycle for Azure AD Connect synchronizes only the changes made to objects and attributes since the last sync, not the entire directory. This efficient process ensures timely updates between on-premises AD and Azure AD.
What is the difference between initial and Delta Sync?
Delta Sync applies only the changes made since the last run, while Initial Sync updates every object and attribute from scratch
Sources
- https://lazyadmin.nl/it/force-azure-ad-sync-delta/
- https://adamtheautomator.com/delta-sync/
- https://blog.quest.com/understanding-azure-ad-sync-an-overview-of-azure-ad-connect-sync-and-cloud-sync/
- https://blog.quest.com/azure-ad-connect-how-it-works-and-best-practices-for-synchronizing-your-data/
- https://activedirectorypro.com/force-sync-azure-ad-connect-using-powershell/
Featured Images: pexels.com