Learn how to synchronize Duo users and groups from your existing Azure Active Directory (AAD) domain.
Import Duo user names and other identity information directly from your Azure Active Directory (AAD) cloud service into Duo with Duo Security's Directory Sync feature.
Duo Directory Sync is a one-way operation. No information from Duo is imported into your user directory. Scheduled synchronization of your full directory runs twice a day, or on-demand when initiated from the Admin Panel. You can also run an individual user sync on-demand from the Admin Panel or programmatically via Admin API.
The Directory Sync feature is part of the Duo Beyond, Duo Access, and Duo MFA plans.
Before executing any directory synchronization with Duo, understand the effect that synchronization can have on accounts with the duplicate Duo usernames. Suppose that you already have some active Duo users, and one or more of these users have the same username in Azure. Performing a synchronization will cause the existing Duo users' information to be merged with, and in some cases overwritten by the Azure AD information, such as email addresses present in Duo changing to match the value stored in the synced directory.
Likewise, if you synchronize multiple directories and there are non-unique usernames among those directories, the net result is that there will be only one Duo user created with that username, and each sync will update that Duo user with different information.
Multiple directory syncs that use non-unique user names or the same selected groups may also produce undesired results, as each sync process could overwrite the user with different information or update the group memberships for a given user unexpectedly.
Before setting up Azure AD sync, ensure you have the following:
To start setting up Azure AD synchronization:
Log in to the Duo Admin Panel and click Users in the left side bar. Then click Directory Sync on the submenu or click the Directory Sync button on the Users page.
If you have any existing directories configured to sync with Duo, they'll be shown here.
While on the Azure Active Directory tab click the Add New Azure Active Directory Sync button.
The "New Azure AD Sync" page prompts you to authorize Duo's access to your Azure directory. Click the Authorize button to grant Duo access to read information from your Azure AD domain.
Clicking the Authorize button takes you to the Azure AD portal. Sign in with the designated Azure service administrator account that has the global administrator role for this Azure Active Directory. If required, complete Azure MFA for that service account admin user.
Duo does not see or store your Azure Active Directory administrator credentials.
If you are already signed into to the Azure portal as the Duo service account, you may not be prompted to log in again here.
Once you've signed in to Azure, you must click Accept to grant Duo the read rights needed to import users from your Azure AD domain.
Authorizing the Azure application redirects you to the details page for your new directory sync in the Duo Admin Panel. The new directory's name defaults to your Azure AD's organization name. Click the Rename link if you'd like to change the directory sync's name to something different, clicking Save to apply the new name.
Verify that the "Status" shows that the directory is connected and the "Authorization" section correctly shows your Azure AD organization name. If the page lists the wrong Azure AD domain, click the Reauthorize button to begin again.
If the status is "Connected" and the domain authorization information is correct, complete configuration of your new Azure sync directory.
Make changes here if you want to customize which Azure AD attribute values get imported to Duo. The Duo attributes that have default Azure AD attributes defined indicate those defaults as helper text. You can change these default attributes to custom attributes of your choice. Some Azure AD attributes have a different property name in Microsoft Graph that you may need to specify instead to use that attribute; see a list of Microsoft Graph property name differences here. Return to using the default attributes by clicking Revert all attributes to default.
You may customize the Azure AD source attributes for these Duo user properties:
Required. The source attribute for the Duo username. The attribute selected should match the primary authentication login name your users submit to Duo. This attribute cannot be customized after the first directory synchronization occurs.
When creating a new user from Azure, Duo defaults to using the entire Azure
If you enable this option after performing your first sync, the next sync updates all managed users to remove the UPN suffix from their usernames.
Specifying a different source attribute for Username removes the normalization option.
Note that you still need to specify the user's full UPN Azure username to perform a sync of individual users from the Admin Panel. The Duo username remains normalized.
Specify up to eight directory attributes to import as additional usernames for each Duo user by clicking Add a username alias attribute, choosing which alias number to define, and entering the desired source attribute from your directory.
For example, if the Username source attribute is
Be sure to choose directory attributes that have unique values (email address, employee ID, etc.). If any of the username or username alias attribute values is the same for two or more users, those users will be skipped by the sync process.
Unlike the Username, the attributes used for username aliases may be changed after the first directory synchronization.
Default: No aliases imported. Aliases may be defined manually from the Admin Panel or programmatically via Admin API on a per-user basis.
Required. The user's name.
Required. The user's email address. This is used as the destination address for enrollment emails from Duo.
Additional information about the users.
Default: No notes imported. Notes information may be defined manually from the Admin Panel or programmatically via Admin API on a per-user basis.
Enable this option if you want Directory Sync to create phones in Duo using your Azure AD users' Office Phone and Mobile Phone property values. Imported devices default to the "Generic Smartphone" platform.
If you enable both the Enrollment email and Import phones options, enrollment links are only sent to users with email addresses who do not have phone information populated in Azure AD.
Default: Import no phone information from Azure AD.
Required. Create a phone in Duo with the attribute value as the phone number, attached to the imported user as a generic smartphone 2FA device. Non-US numbers must be stored in Azure using the format
To import a landline with an extension, append
Only configurable if Import phones is selected.
Create a phone in Duo with the attribute value as the phone number, attached to the imported user as an additional generic smartphone 2FA device. Non-US numbers must be stored in Azure using the format
To import a landline with an extension, append
Only configurable if Import phones is selected.
If you make any changes from the synced attribute defaults, be sure to click the Save Directory button. When you save, Duo validates any non-default source attributes you customized against Azure and flags any invalid attributes. Correct the Azure source attribute name and save again.
Do not configure the same selected groups from your source directory in multiple Duo directory syncs. Each sync process may update the group memberships for a given user with undesirable effects on your configured custom application group policies, permitted groups restrictions, or administrative unit assignments.
Click in the Selected Groups box and start typing an Azure AD group name; the list of available groups to sync returned will match the filter. If you have a very large number of groups in your Azure directory, Duo limits the search results to 100 groups, so you may need to type in most if your desired sync group's name to locate it.
If you don't see any of your Azure groups listed, review the previous setup steps and correct your configuration.
Once you see a list of groups, click to select the desired group or groups to sync, then click Save Directory once you've added all the groups you want to import. You can select up to 400 groups to sync from the source directory. Members of the groups you choose here will be synced into Duo.
Nested groups are supported; Duo sync imports users from groups nested within your sync group, but creates only the top level group in Duo (the group explicitly selected for directory sync), with all nested group members as direct members of that Duo group.
If you delete and recreate any of the Azure groups saved in the sync properties (even if you reused the same group name and members), then you'll need to return to the directory sync property page for your Azure domain on the Duo Admin Panel and delete the recreated group from your sync configuration, then re-add the group, and save the directory.
If you save the sync without selecting any groups, or if you remove all the groups selected from the sync config in the future, Duo pauses your scheduled sync upon detecting the missing information and updates the sync status to alert you that no groups have been selected. Correct the issue by selecting one or more groups to sync from the source directory and resuming scheduled synchronization.
Select the Enrollment Email option if you want imported users to automatically receive an enrollment link email when the sync process completes. Only users imported with active status, a valid email address, and who do not already have any enrolled authentication devices in Duo receive an emailed link. The email address is populated by Azure AD sync.
Default: Do not send enrollment emails to imported users.
The enrollment link sent when the sync first imports a user is valid for 30 days. Duo sends an emailed enrollment reminder if the user hasn't yet completed enrollment after two days, and then a second reminder if the user remains unenrolled eight days after the first reminder.
If the user does not complete the enrollment process after 30 days has elapsed, the original enrollment link expires and a new enrollment link is generated at the next sync and sent to the user. This entire 30 day cycle repeats until the user completes Duo enrollment.
The contents of the enrollment email subject and body can be changed on the global Settings page. The enrollment email body should contain the placeholder text "<enrollment-link>", which will be replaced by the link to the enrollment form when the email is sent. The sent message will have a non-editable header added, informing the user it's an automated message sent by Duo and to contact their organization's Duo admins or IT support group with any questions.
If your organization uses e-mail filtering, be sure to allow the sender firstname.lastname@example.org.
Click Save Directory to complete the new Azure AD directory setup in Duo.
Duo Beyond and Duo Access Plan Users: Global Policy settings affect access to the enrollment portal. Do not apply any global restrictions that could prevent user enrollment. For example, if you configure the User Location policy setting to deny access to a country, then the policy will also block any of your users who attempt to enroll in Duo from that country via an emailed enrollment link. The New User Policy setting for the enrollment portal is always "Require Enrollment".
When setup is complete you may edit the Duo service account in Azure that you used to authorize the Duo application to drop the account's role privileges to any role with lesser privileges. Once you've authorized the sync the account no longer requires the Global Administrator role.
The directory page shows the status as Connected once all directory configuration steps have been completed successfully. You'll also see options for Authorization, Sync directory, and Sync individual users.
Click Sync Now to run your first sync and immediately import all members of your selected Azure AD groups into Duo.
When complete, you'll see a count of users and groups synced into Duo.
Whether you run your first sync immediately after setup or not, directory sync runs automatically twice a day (at a set 12-hour interval chosen at random). You can always return to the Duo Admin Panel to initiate a manual sync.
Note that once you import users from Azure into Duo you may not change the Azure username source attribute, but you can enable or disable username normalization. See the FAQ for more information.
Role required: Owner, Administrator, User Manager, or Help Desk.
When you just need to import information for a few users from Azure AD you can interactively sync selected users instead of syncing the entire directory. For example, you may have some new employee accounts in Azure who need a corresponding Duo account, or you might have just disabled an Azure user and need that status carried over to Duo. Syncing these individual user accounts updates Duo immediately.
To sync individual users:
Navigate to the directory's details page in the Duo Admin Panel.
Type up to 50 Azure user names as a comma-separated list into the Sync individual users text box found in the "Directory Sync" section on the directory's properties page. If you used
userPrincipalName as the Duo username source attribute (the default), then you must enter each username in full UPN format, such as "email@example.com", even if you enabled username normalization in the sync configuration. If you used a different source attribute for the Duo username, you must type each username exactly as it is shown (or will be shown) in Duo i.e. if you opted to use
Additionally, individually synced users must be members of a group specified as a "Selected Group" in your directory's configuration. If you try to sync an individual user who is not a member of a selected group then no update of that user occurs.
Click the Sync Users button to import information about the specified user or users.
When initiated, the individual user sync verifies that each specified user is a member of a group currently synced with Duo and then imports information for that user into Duo. If a specified user doesn't already exist in Duo, the sync creates them using the information imported from the source directory. If you enabled the option to send enrollment emails and the new user has the email address attribute populated, then a new user created by the individual user sync receives an emailed enrollment link.
Individual user sync updates an existing specified user with information from the source directory. The sync can change attribute values (except the username), modify group memberships, or disable the user in Duo if they are disabled in the source directory.
If you include a specified user that is no longer a member of any group synced into Duo, then the sync marks the user for deletion.
In addition to syncing individual users by username from the directory's details page, you can also perform an individual sync on an existing Duo user by visiting that user's properties page in the Duo Admin Panel and clicking the Sync This User link at the top-right. If you enabled the "Normalize usernames" option when configuring the Azure sync in Duo, (so that the usernames don't include the Azure domain information) then user pages won't show the option to sync, and you'll need to visit the directory sync page to perform the individual sync as previously described.
Use the AdminAPI directory key from the "Directory Sync" section of the page to perform a sync operation on an individual user using Duo's Admin API.
After importing users from your directory into Duo, your next step is to have them activate their devices for Duo authentication (if you chose not to send enrollment emails to synced users when creating your directory in Duo). On the Users page you'll see a notification bar indicating that users have not yet activated the Duo Mobile smartphone app. Click the link in the notification bar to begin the process of sending these users activation links.
For more information on user activation, see Activating Duo Mobile After Enrollment.
If you did choose to send enrollment emails to synced users automatically, the Pending Enrollments table shows which users created by directory sync (or bulk enrollment) have not yet completed enrolling their 2FA devices in Duo, along with the user's email address and the expiration date for the enrollment link previously sent.
If you need to send a user another copy of the enrollment link email, click the Resend button on the right of that user's information, or click Resend All to send the email again to all users with outstanding enrollment links. Resending the email does not change the current enrollment link's expiration date and uses the same email address that was used when the original enrollment was sent.
Click Delete to remove a pending enrollment. Deleting a pending enrollment immediately invalidates any unexpired enrollment link previously sent to that user. The next time directory sync runs, a new enrollment link will be emailed to that users, as long as they remain a member of a synced group and the sync configuration still has the "Enrollment Email" option enabled.
User attributes synced from an external directory cannot be edited in Duo via the Admin Panel, Admin API, or CSV import. This always applies to the required attributes username, full name, email address, plus phone numbers (if you chose to import phones), and group memberships. Changes to these user attributes should be made in the external directory and then synced over to Duo.
You may edit Duo user properties that aren't synced from Azure via the Admin Panel, Admin API, or CSV import, including those that correspond with optional Azure AD sync attributes you chose not to import. However, if you update your Azure AD sync to begin importing values for a previously unconfigured optional attribute, the sync will overwrite any previously configured values with the information imported from Azure.
You do not specify a source attribute for Notes when you create your Azure AD directory sync. The sync imports the username, email, and name from Azure, but imports no notes information. You can edit the "Notes" field for synced Duo users. but you may not edit the "Username", "Full Name", or "Email" properties for synced users.
You specify a source attribute for Username alias 1 but not for the remaining aliases. The sync imports values for "Username Alias 1" from Azure, and no other aliases. You can't edit "Username Alias 1" for a synced user, but you can edit additional aliases beyond the first.
You do not specify a source attribute for Username alias 1. The sync creates users with no aliases, and you manually add values for "Username Alias 1" to some Duo users from the Admin Panel. You update your configured Azure AD sync to add a source attribute for Username alias 1. The next sync updates the "Username Alias 1" value for all synced users to match the value in Azure, overwriting the aliases you added manually.
Admins can't disable individual Duo users managed by directory sync from the Duo Admin Panel, Admin API, or CSV import. Directory sync checks the user account status in the source directory and uses that information to determine whether the corresponding Duo account should remain enabled.
If a synced user account is disabled in the source directory, on the next sync Duo updates the user's status to "Disabled" but does not send that user to the Trash, and retains the user's group memberships. The user remains read-only, and cannot be manually enabled.
You can restore the disabled Duo account to active status by enabling the account in the source directory and running a sync.
You may disable a group of synced users by changing the status of that group to Disabled. This prevents any user who is a member of that group from logging in with Duo, regardless of that individual user's status. See the Using Groups and Group Status Administration documentation for more information.
You may not delete a synced user from Duo as long as directory sync is actively managing that user. If a synced directory user is removed from all external directory groups that sync to Duo (or if the user account is deleted from the source directory), the user is sent to the Trash and marked as "Pending Deletion" at the next full directory sync or individual sync for that user, and the user can no longer authenticate to Duo. The user's properties are read-only and you are no longer billed for that user.
Locate users pending deletion in the Trash view, accessed by clicking the Trash count shown at the top of the Users page.
If the user marked for deletion is not reconnected to an external directory account via the sync within seven days the user is automatically deleted from Duo. The user's properties show the target date for deletion. A Duo admin can manually delete a synced user from the Trash via the Permanently Delete link at any time during those seven days.
Duo groups created by directory sync may only be managed by the sync. You can't change the group's members interactively from the Admin Panel interface, via CSV import, or programmatically with the Admin API.
To update the members of a sync-managed group, make the necessary changes in the source directory and import them into Duo by running a full or single-user sync.
Groups managed by Active Directory sync are identified as such in the Admin Panel and Admin API output. When viewing groups in the Admin Panel, you'll see from Azure Sync "name of sync" appended to the group's name or as the group's description. In Admin API output the sync information is appended to the group's name.
You can have multiple syncs managing groups with the same name (such as a "Duo Users" group managed by AD sync and also a "Duo Users" group managed by Azure sync), or even a manually created "Duo Users" group not managed by any sync. Each sync-managed group only contains Duo user members managed by the same directory sync, and an unmanaged group can only contain users also not managed by any directory sync.
Removing a group from the directory's configuration in Duo marks any members of that group for deletion if they are not members of another synchronized group, and converts the group to unmanaged so it can be modified or deleted from the Duo Admin Panel or Admin API. Duo updates the group's name to indicate it was once managed by directory sync, changing from Group name from Azure Sync "name of sync" to Group name (formerly from "name of sync").
If the Duo Sync application's authorization in Azure expires then scheduled syncs stop running. We'll automatically pause the scheduled sync and send an "Action required" email to all the Duo administrators with the "Owner" role to let them know.
When you visit your Azure directory sync configuration page in the Duo Admin Panel, the Status information shows you the state of your directory connection.
If the status says "Could not connect to Azure: Reauthorization required", then click the Reauthorize button to repeat the authorization step you performed when you originally configured the sync. If the Azure account you'll use to reauthorize the sync had its privileges reduced after the first authorization, temporarily apply the Global Administrator role again before clicking Reauthorize.
Successful reauthorization of the Duo Azure AD Sync application also automatically resumes scheduled syncs for that directory.
Should you want to put your directory sync on hold to prevent it from making changes to your imported users, you can do so without removing your Azure Active Directory configured sync from Duo. Use the pause functionality to stop scheduled syncs from running until you want to resume them.
To pause or resume synchronization of a directory:
In the Duo Admin Panel, navigate to Users → Directory Sync and click the Azure Active Directory tab.
Click on the directory for which you want to pause or resume scheduled syncs to view its configuration page.
Click the Pause Scheduled Syncs or Resume Scheduled Syncs button in the Directory Sync "Status" section to perform the stated action. The sync status updates to reflect the effective state of the scheduled sync.
You can perform manual full and individual syncs at any time from the Admin Panel or via Admin API while the scheduled sync remains paused.
If your Azure sync has no selected groups in the configuration then we'll pause scheduled syncs right away and the sync's status will show an alert for no groups selected. Select a group or groups and save the change to resume the sync.
Duo tracks failures of your scheduled directory synchronizations. We'll send a notification email to all Duo administrators with the Owner, Administrator, or User Manager roles after three (3) days of consecutive sync failures. If the failure persists, we'll send additional notification emails after seven (7) and 14 days. Duo will send a final email notification after 30 days of consecutive sync failures and pause the scheduled sync automatically.
Visit your Azure directory sync's page in the Admin Panel to correct the issues preventing sync success, or delete the directory sync if you no longer wish to use it.
To resume the paused sync after correcting any issues, click the Resume Scheduled Syncs button in the Directory Sync "Status" section.
Deleting a directory from Duo doesn't delete or disable any of the previously imported objects. When you delete a synced directory from Duo, then the users, phones, and groups formerly managed by that sync remain available and get converted to unmanaged Duo objects that can be manually updated or deleted.
Users previously synced remain available and retain the status previously assigned, whether applied to the synced group or to the individual user. Any authentication devices associated with the user remain available. The users retain their former group memberships.
Groups previously synced remain available and retain the same members and status assigned when they were managed by the sync. The group name changes from Group name from type of sync "name of sync" to Group name (formerly from "name of sync").
Phones previously synced remain in Duo attached to the same users. Activation status remains unchanged.
To delete a synced directory:
In the Duo Admin Panel, navigate to Users → Directory Sync and click the Azure Active Directory tab.
Click on the directory you want to delete to view its configuration page.
Click the Delete Directory link at the top-right and confirm that you want to delete that directory.
Be sure to review frequently asked questions and answers before using Duo's Active Directory synchronization.
Need some help? Take a look at the Azure Directory Sync Frequently Asked Questions (FAQ) page or try searching our Azure Directory Sync Knowledge Base articles or Community discussions. For further assistance, contact Support.
On the details page of your Azure sync there is a Troubleshooting section under the “Sync Now” button. Here you'll find tips to help your sync run as intended. If you are still having issues and need to open a support case with Duo, you can click Sync Full Directory with Diagnostics to provide Duo Support with more information about your sync.
Additionally, a sync reference code is now provided on every sync. This will be included on every Azure sync event captured in the Administrator Actions Log, as well as within any emails Duo sends you about sync errors. Duo Support will request this code to locate logs associated with your sync.