Azure AD Directory Integration with Thunai
You can integrate your Azure Active Directory (Azure AD) with Thunai to automatically sync users. Once synced, users will appear in the Thunai Directory module, where you can manage them for features like access restrictions in agents.
Before You Begin
Ensure you have Admin access to your Azure AD tenant.
Keep the following details from your Azure AD App Registration ready:
- Client ID
- Client Secret
- Tenant ID
Steps to Connect Azure AD Directory
Step 1: Configuration
- Log in to your Thunai Admin portal.
- Select the tenant where you want to sync the directory.
- Navigate to Settings > Directory, then click Directory Sync.
- Click Add Directory and choose Azure AD.
Enter the following details:
- Client ID*
- Client Secret*
- Tenant ID*
(Optional) Enable Auto Deletion for Users:
- If a user is deleted in Azure AD, they will also be deleted from Thunai during the next sync.
👉 How to Get These Details from Azure AD:
- Sign in to the Azure Portal.
Navigate to Azure Active Directory > App Registrations.
Create a New Registration (or use an existing one).
Note the Application (Client) ID.
Go to Certificates & Secrets and generate a Client Secret.
- Copy and save the secret securely.
Go to Overview and copy the Directory (Tenant) ID.
Assign the app the required API Permissions:
- Microsoft Graph > User.Read.All (Application permission)
- Microsoft Graph > Directory.Read.All (Application permission)
- Grant Admin Consent for these permissions.
Step 2: User Mapping
Map Azure AD attributes to Thunai schema attributes.
Only mapped users will be synced into Thunai.
Example mapping:
userPrincipalName
→email
givenName
→firstName
surname
→lastName
Step 3: Policy
Define sync conditions (optional).
- Example: Sync only users from certain groups or with specific roles.
- This ensures only the required users are synced into Thunai.
Step 4: Scheduler
Choose how you want to sync users:
One-time sync (manual)
Periodic sync:
- Every hour
- Daily at a specific time
Step 5: Sync & Manage
After setup, users will be synced into Thunai Directory and shown with Onboarded status.
You can:
- View the Job List.
- Perform a Manual Sync anytime by clicking Sync.
- Update the Directory Configuration when required.
Once users are synced into Thunai Directory, you can use them in agent access restriction policies..