> ## Documentation Index
> Fetch the complete documentation index at: https://dub.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring SCIM Directory Sync with Azure AD

> For Dub Enterprise users, you can automatically provision and deprovision users from Azure AD to Dub using SCIM Directory Sync.

<Tip>
  This feature is only available on [Dub Enterprise](https://dub.co/enterprise).
</Tip>

For Dub Enterprise users, you can automatically provision and deprovision users from your Azure Active Directory (AD) to Dub using [SCIM Directory Sync](https://learn.microsoft.com/en-us/azure/active-directory/architecture/sync-scim).

## Step 1: Configure Directory Sync on Dub

In your workspace dashboard on Dub, click on the **Settings** tab in the menu bar at the top. Then, click on the **Security** tab in the sidebar.

<Frame>
  <img src="https://assets.dub.co/cms/saml-directory-sync-2.png" alt="Directory Sync section on the Dub Dashboard" />
</Frame>

Under the **Directory Sync** section, click on **Configure**. This will open up the Directory Sync modal:

1. Select **Azure AD** as the Directory Provider.
2. Click **Save changes**.

<Frame>
  <img src="https://assets.dub.co/cms/scim-entra.png" alt="SCIM Modal" />
</Frame>

This will generate a Directory Sync connection for your Dub workspace, and return 2 values, which will be needed in Step 2:

1. **Tenant URL**
2. **Secret Token**

<Frame>
  <img src="https://assets.dub.co/cms/scim-entra-confirm.png" alt="SCIM Modal" />
</Frame>

## Step 2: Add Provisioning to SAML Application

Click on the **Provisioning** tab of your existing Dub Okta SAML application that you want to enable SCIM provisioning for.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-tab.png" alt="Provisioning tab of Okta SAML application" />
</Frame>

In the Provisioning tab, click on **Get started**.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-get-started.png" alt="Get started with provisioning" />
</Frame>

Select **Automatic** from the **Provisioning Mode** dropdown. Under the **Admin Credentials** section, enter the values that you obtained from Step 1:

1. **Tenant URL**
2. **Secret Token**

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-provisioning.png" alt="Provisioning tab of Azure SAML application" />
</Frame>

Click on **Test Connection** to test the connection to see if the credentials are correct, then click **Save** to save the credentials.

Expand the **Mappings** section and ensure group and user attribute mappings are enabled for your app. The default mapping should work.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-mappings.png" alt="Mappings section of Azure SAML application" />
</Frame>

Expand the **Settings** section and make the following changes:

* Select **Sync only assigned users and groups** from the **Scope** dropdown.
* Confirm the **Provisioning Status** is set to **On**.

Click **Save** to save the changes.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-settings.png" alt="Settings section of Azure SAML application" />
</Frame>

Congratulations! You've successfully configured SCIM provisioning for your Dub workspace.

## Step 3: Assign Users

Once you've configured Directory sync, you can assign users to Dub directly within Azure AD.

From your application, click the **Users and groups** from the left navigation menu and click **Add user/group**.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-add-users.png" alt="Adding users in Azure AD" />
</Frame>

Click on **None Selected** under **Users**.

From the right side of the screen, select the users you want to assign to the app and click the **Select** button. Thenm click **Assign** to those users to your app.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-assign-user.png" alt="Assigning users in Azure AD" />
</Frame>

Your assigned users should now receive an invitation email to join your Dub workspace.

<Frame>
  <img src="https://assets.dub.co/help/saml-invite.png" alt="SAML invite email" />
</Frame>

<Warning>
  Azure AD SCIM provisioning can take [anywhere between 20-40 minutes to
  sync](https://learn.microsoft.com/en-us/azure/databricks/administration-guide/users-groups/scim/aad#provisioning-tips).
  This means that it may take up to 40 minutes for your users to receive the
  invitation email and be able to join your Dub workspace.
</Warning>

They will also be able to sign in to Dub using Azure AD SSO
