Azure AD Connect Staging Mode is a feature that allows you to test and validate changes to your Azure AD synchronization without disrupting your production environment. This is especially useful when you're introducing new features or updates to your synchronization process.
By enabling Staging Mode, you can create a separate instance of Azure AD Connect that mirrors your production environment, allowing you to test and validate changes without affecting your live data. This helps minimize the risk of errors or disruptions to your users.
In Staging Mode, Azure AD Connect creates a separate database and configuration that is isolated from your production environment. This means you can make changes and test them without impacting your live users.
What Is Azure AD Connect Staging Mode?
Azure AD Connect Staging Mode is a feature that allows you to test and validate changes to your Azure AD sync configuration before applying them to your live environment.
It's essentially a sandbox area where you can simulate changes and see how they'll affect your users and groups without actually making the changes.
In this mode, you can test and validate changes to your Azure AD sync configuration, including updates to your on-premises Active Directory, without affecting your live environment.
You can test synchronization rules, attribute mappings, and other configuration changes in a controlled environment.
This allows you to identify and fix any issues before applying the changes to your live environment.
Azure AD Connect Staging Mode is a safe and efficient way to test and validate changes, reducing the risk of errors or downtime.
Preparing for Staging Mode
To set up staging mode, you'll first need to install Microsoft Entra Connect, but select staging mode and unselect start synchronization on the last page of the installation wizard. This will allow you to run the sync engine manually.
You'll also need to make sure you have a spare standby server, as having one or more is recommended for complex environments. During installation, you can enable a server to be in staging mode.
To confirm your environment is ready, you'll need to verify a few prerequisites. These include having one currently active Microsoft Entra Connect Sync Server, one staging Microsoft Entra Connect Sync Server, and the staging server has the synchronization scheduler enabled and has synchronized with Microsoft Entra ID recently.
Before proceeding, also confirm that your Microsoft Entra Connect Sync Server is configured to prevent accidental deletes, and verify the pending exports and confirm that there aren't significant updates, and such updates are expected.
Here are the specific prerequisites to check:
- One currently active Microsoft Entra Connect Sync Server
- One staging Microsoft Entra Connect Sync Server
- The staging server has the synchronization scheduler enabled and has synchronized with Microsoft Entra ID recently
- In case of any updates in synchronization rules or in sync scope, run an initial sync cycle
- Confirm that your Microsoft Entra Connect Sync Server is configured to prevent accidental deletes
- Verify the pending exports and confirm that there aren't significant updates, and such updates are expected
- Check if Microsoft Entra Connect Health agent is updated by checking the server in Microsoft Entra Connect Health portal
- Switch the current active server to staging mode, before switching the staging server to active
Configuring Staging Mode
To configure staging mode, you'll need to stop actively synchronizing information between Active Directory and Azure AD. This will freeze the information and allow you to compare the metaverses of the actively synchronizing Azure AD Connect installation and the Azure AD Connect installation that is to become the active installation.
You can stop active synchronization by starting Azure AD Connect from the desktop, acknowledging User Account Control, and selecting Configure staging mode. Then, sign into Azure AD with an account that has Global Administrator/Company Administrator privileges and perform multi-factor authentication when needed.
To confirm that staging mode is enabled, verify the value of the "StagingModeEnabled" setting using the ADSync Scheduler configuration in Windows PowerShell. The value should be True if the server was successfully switched to staging mode.
You can also use Microsoft Entra Connect configuration documenter to compare the configuration with the staging server if you've made custom changes to the primary server.
Here are the steps to configure staging mode:
- Start Azure AD Connect from the desktop.
- Acknowledge User Account Control and select Configure staging mode.
- Sign into Azure AD with an account that has Global Administrator/Company Administrator privileges and perform multi-factor authentication when needed.
- Verify the value of the "StagingModeEnabled" setting using the ADSync Scheduler configuration in Windows PowerShell.
Switching to Staging Mode
To switch to staging mode, you'll need to move your currently active Sync Server to staging mode. This ensures that only one Sync Server is syncing changes at any given time.
To do this, open the Microsoft Entra Connect wizard and click "Configure staging mode" then Next. The Microsoft Entra Connect server will then check for installed components and prompt you to start the sync process when the configuration change completes.
It's recommended to leave the sync process on for the server in Staging Mode, so if it becomes active, it will quickly take over and won't have to do a large sync to catch up to the current state of the Active Directory / Microsoft Entra objects in scope.
You can confirm that the server is successfully in Staging Mode by opening Windows PowerShell, loading the "ADSync" module, and verifying the ADSync Scheduler configuration using the following commands:
From the results, verify the value of the "StagingModeEnabled" setting. If the server was successfully switched to staging mode, the value of this setting should be True.
Troubleshooting and Recovery
If you're experiencing issues with Azure AD Connect, don't panic - troubleshooting and recovery are just a few clicks away.
To begin, make sure you're in Staging Mode, which allows you to test and validate changes without affecting your production environment. This is especially useful for debugging issues with your sync configuration.
If you're still having trouble, check the Event Viewer logs for errors related to Azure AD Connect. You can find these logs by searching for "Azure AD Connect" in the Event Viewer.
In most cases, you can resolve issues by restarting the Azure AD Sync service. This simple step can often resolve connectivity problems and get your sync running smoothly again.
Rebuild When Needed
Rebuild when needed is a viable strategy for troubleshooting and recovery. This approach involves planning for a server rebuild when necessary.
Installing the sync engine and doing the initial import and sync can be completed within a few hours. This makes it a quick and efficient solution for resolving issues.
A spare server is ideal for rebuilding the sync engine, but it's not always possible to have one available. In this case, a domain controller can be temporarily used to host the sync engine.
The sync engine server doesn't store any state about the objects, so the database can be rebuilt from the data in Active Directory and Microsoft Entra ID. This is a significant advantage of this approach.
The sourceAnchor attribute is used to join the objects from on-premises and the cloud. If you rebuild the server with existing objects on-premises and the cloud, then the sync engine matches those objects together again on reinstallation.
To ensure a smooth rebuild, it's essential to document and save the configuration changes made to the server, such as filtering and synchronization rules. These custom configurations must be reapplied before you start synchronizing.
Here's a summary of the key steps to rebuild the sync engine:
- Plan for a server rebuild when necessary.
- Install the sync engine and do the initial import and sync.
- Use a spare server or a domain controller to host the sync engine.
- Rebuild the database from the data in Active Directory and Microsoft Entra ID.
- Document and save the configuration changes made to the server.
- Reapply custom configurations before starting to synchronize.
When Azure Connect Fails FS
If you're not using Azure AD Connect to manage AD FS, you'll need to update the transformation rules for the Microsoft Office365 Identity Platform Relying Party Trust (RPT) in AD FS.
To do this, open Internet Explorer and navigate to adfshelp.microsoft.com. Click on the Online Tools tile, then the Azure AD RPT Claim Rules tile. Follow the wizard to generate claims, copy the PowerShell script, and paste it into an elevated PowerShell ISE window.
Save the script to a folder on your hard disk, then run it on the primary AD FS server to set the correct claims. The script will make a backup of the current issuance transformation rules, which you can roll back if needed.
This is a good practice to have, especially if you're planning for disaster recovery. In case of a disaster, you'll want to be able to quickly roll back to a previous version of Azure AD Connect or AD FS.
Here are the steps to update the transformation rules again, in case you need to refer to them later:
- Open Internet Explorer and navigate to adfshelp.microsoft.com.
- Click on the Online Tools tile, then the Azure AD RPT Claim Rules tile.
- Follow the wizard to generate claims, copy the PowerShell script, and paste it into an elevated PowerShell ISE window.
- Save the script to a folder on your hard disk.
- Run the PowerShell script on the primary AD FS server to set the correct claims.
Remember, it's essential to have a backup plan in place, especially when it comes to critical systems like AD FS and Azure AD Connect. By following these steps and having a rollback plan in place, you'll be better equipped to handle any issues that may arise.
Release Management and Maintenance
To successfully implement Azure AD Connect release management, you'll need to follow a specific set of steps. Changes are made on the Staging Mode server only.
The process starts with a manual synchronization cycle on the actively synchronizing Azure AD Connect installation, for the last time. This ensures that any pending changes are applied before switching to Staging Mode.
The actively synchronizing Azure AD Connect installation is then configured in Staging Mode, allowing you to test and validate changes without affecting the production environment.
A manual synchronization cycle is started on the Staging Mode Azure AD Connect installation, which is intended as the newly actively synchronizing Azure AD Connect installation.
Before the initial synchronization out of Staging Mode, the metaverse is compared between the previously actively synchronizing Azure AD Connect and the Azure AD Connect installation intended as the newly actively synchronizing Azure AD Connect installation.
Here's a summary of the steps involved in implementing Azure AD Connect release management:
- Changes are made on the Staging Mode server only.
- A manual synchronization cycle is started on the actively synchronizing Azure AD Connect installation, for the last time.
- The actively synchronizing Azure AD Connect installation is configured in Staging Mode.
- A manual synchronization cycle is started on the Staging Mode Azure AD Connect installation, that is intended as the newly actively synchronizing Azure AD Connect installation.
- The metaverse is compared between the previously actively synchronizing Azure AD Connect and the Azure AD Connect installation, intended as the newly actively synchronizing Azure AD Connect installation.
- The updated Staging Mode Azure AD Connect installation is configured as no longer being in Staging Mode, becoming the actively synchronizing Azure AD Connect installation.
- Update the issuance transformation rules for the Microsoft Office 365 Identity Platform Relying Party Trust (RPT) in AD FS.
It's also worth noting that you can run multiple Staging Mode servers in an AADC environment, as confirmed by Amit Kumar in a comment on the article "5 Responses to Leveraging Azure AD Connect Staging Mode for Release Management".
Manual Synchronization and Claims Rules
To synchronize the latest changes from Active Directory to Azure AD, and vice versa, perform a manual synchronization cycle on the Staging Mode Azure AD Connect installation.
To do this, open an elevated Windows PowerShell window and issue the following line of PowerShell: `EndFragment`
This step puts the changes in the Azure AD Connect version and the accompanying synchronization rules in production.
After manual synchronization, you'll need to update the issuance transformation rules for the Microsoft Office 365 Identity Platform Relying Party Trust (RPT) in AD FS.
Here are the steps to update the AD FS Claims Rules:
* Update the issuance transformation rules for the Microsoft Office365 Identity Platform Relying Party Trust (RPT) in AD FS.
These rules are crucial for ensuring seamless integration between Azure AD and on-premises AD.
By following these steps, you'll have successfully completed the manual synchronization and claims rules update process in Azure AD Connect Staging Mode.
Azure AD Connect Best Practices
Staging mode is a powerful tool in Azure AD Connect that allows you to test and deploy new configuration changes without affecting your primary server.
You can use staging mode for high availability, test and deploy new configuration changes, or introduce a new server and decommission the old. To enable staging mode, simply tick the box during installation and click Next.
A server in staging mode is active for import and synchronization, but it doesn't run any exports, including password sync and password writeback. This means that password changes from on-premises AD will not be synchronized while staging mode is enabled.
Here are some key considerations to keep in mind when using staging mode:
- Make sure to make configuration changes to your primary server and the server in staging mode simultaneously.
- Be aware that if the server is left in staging mode for an extended period, it may take a while to synchronize all password changes that occurred during that time.
Update Claims Rules
To update the AD FS claims rules, you need to navigate to adfshelp.microsoft.com, click on the Online Tools tile, and then click on the Azure AD RPT Claim Rules tile. This will guide you through the process of updating the issuance transformation rules for the Microsoft Office365 Identity Platform Relying Party Trust (RPT) in Active Directory Federation Services (AD FS).
Follow the wizard to generate claims, and after clicking the Generate Claims button, copy the contents of the PowerShell script. Paste the contents in an elevated PowerShell ISE window, save the script to a folder on the hard disk, and then run the PowerShell script on the primary AD FS server to set the correct claims.
The script will make a backup of the current issuance transformation rules, allowing you to roll back to the previous version if needed.
Helpful AI assistant
As a helpful AI assistant, I've learned that Azure AD Connect is a powerful tool for managing hybrid identities. Staging mode is a useful feature that allows you to test and deploy new configuration changes without disrupting the production environment.
In staging mode, the server is active for import and synchronization, but it doesn't run any exports. This means you can still receive changes from Active Directory and Microsoft Entra ID, and the server can quickly take over the responsibilities of another server in the event of a failure.
To apply staging mode, simply tick the box for Staging Mode and click Next during the installation process. This will make the server active for import and synchronization, but it won't start exporting or running password sync or password writeback.
If you make configuration changes to your primary server, it's your responsibility to make the same changes to the server in staging mode. This ensures that both servers are in sync and can handle any potential issues that may arise.
To maintain Azure AD Connect functionality and avoid disruptions, it's essential to follow the principles of control in release management. This includes maintaining the Azure AD Connect functionality at least twice, applying changes to one system at a time, and verifying changes before going to production.
Here are the key layers to consider when controlling Azure AD Connect:
- Hardware, drivers, firmware, and integration components
- Operating System version and patch level
- Azure AD Connect version
- Azure AD Connect rules
- Azure AD Connect configuration
By following these best practices, you can ensure a smooth and efficient Azure AD Connect experience.
Sources
- https://www.refactored.pro/blog/2020/11/10/azure-ad-connect-staging-mode
- https://learn.microsoft.com/en-us/entra/identity/hybrid/connect/how-to-connect-sync-staging-server
- https://dirteam.com/sander/2019/05/09/leveraging-azure-ad-connect-staging-mode-for-release-management/
- https://github.com/Huachao/azure-content/blob/master/articles/active-directory/active-directory-aadconnectsync-operations.md
- https://www.rebeladmin.com/azure-ad-connect-staging-mode/
Featured Images: pexels.com