---
title: SSO to Databricks with Microsoft Entra ID
description: Learn how to set up Azure Active Directory in your Azure tenant for SSO with your Databricks Account.
canonical_url: https://docs.databricks.com/aws/en/security/auth/single-sign-on/azure-ad
---

# SSO to Databricks with Microsoft Entra ID

This page shows how to configure Microsoft Entra ID as the identity provider for single sign-on (SSO) in your Databricks account. Microsoft Entra ID supports both OpenID Connect (OIDC) and SAML 2.0.

Databricks recommends syncing users, service principals, and groups from Microsoft Entra ID using automatic identity management. See [Automatic identity management](https://docs.databricks.com/aws/en/admin/users-groups/automatic-identity-management/index.md). To sync identities using System for Cross-domain Identity Management (SCIM) provisioning instead, see [Sync users and groups from your identity provider using SCIM](https://docs.databricks.com/aws/en/admin/users-groups/scim/index.md).

> [!WARNING]
>
> To prevent getting locked out of Databricks during single sign-on testing, keep the account console open in a different browser window. You can also configure emergency access with security keys to prevent lockout. See [Emergency access to prevent lockouts](https://docs.databricks.com/aws/en/security/auth/single-sign-on/emergency-access.md).

## Enable Microsoft Entra ID single sign-on

Choose your identity protocol:

### OIDC

1. As an account admin, log in to the [account console](https://accounts.cloud.databricks.com) and click **Security**.

2. Click the **Identity provider setup** tab.

3. In the **Authentication** section, configure single sign-on to open the SSO configuration dialog.

4. On the **Add details** step, under **Identity protocol**, select **OpenID Connect**.

5. Make note of the **Databricks redirect URL** value.

6. In another browser tab, create a Microsoft Entra ID application:
   1. Log in to the Azure portal as an administrator.
   2. In the left navigation, click **Microsoft Entra ID**.
   3. Click **App registrations > New registration**.
   4. Enter a name.
   5. Under **Supported account types** choose: **Accounts in this organizational directory only**.
   6. Under **Redirect URI**, choose **web** and paste the Databricks redirect URL value.
   7. Click **Register**.

7. Gather the required information from the Microsoft Entra ID application:
   1. Under **Essentials**, copy the **Application (client) ID**.
   2. Click **Endpoints**.
   3. Copy the URL under **OpenID Connect metadata document**
   4. In the left pane, click **Certificates & secrets**.
   5. Click **+ New client secret**.
   6. Enter a description and choose an expiration.
   7. Click **Add**.
   8. Copy the secret **value**.

8. Return to the SSO configuration dialog in the Databricks account console and enter the values you copied from the identity provider application in the **Application (Client) ID**, **Client secret**, and **Authority URL / Issuer** fields. Remove the `/.well-known/openid-configuration` ending from the URL.

   You can specify query parameters by appending them to the issuer URL, for example `{issuer-url}?appid=123`.

9. Optionally, set a **User attribute claim** if you want to use a claim other than `email` as users' Databricks usernames. For more information, see [Customize a claim to use for your account's usernames](https://docs.databricks.com/aws/en/security/auth/single-sign-on/azure-ad.md#claim).

   ![Single sign-on tab when all values have been entered](https://docs.databricks.com/aws/en/images/sso/oidc-sso.png)

10. On the **Enable SSO** step, click **Enable SSO**. Databricks saves the configuration in a disabled state and runs a connection test. You are redirected to complete a sign-in with Microsoft Entra ID. If the test succeeds, SSO is enabled automatically. If the test fails, Databricks reports that it couldn't validate the configuration. Review the values you entered and try again.

11. After SSO is enabled, use the next-steps card to choose how to provision users from Microsoft Entra ID:
    * To automatically enable users from your identity provider, click **Configure** for Automatic Identity Management (AIM). See [Automatic identity management](https://docs.databricks.com/aws/en/admin/users-groups/automatic-identity-management/index.md).
    * To create user accounts the first time a user signs in, enable just-in-time (JIT) provisioning using the **Create new identities during first-time signup** toggle. See [Automatically provision users (JIT)](https://docs.databricks.com/aws/en/security/auth/jit.md).

For detailed post-setup testing guidance, including workspace login testing, see [Test your SSO configuration](https://docs.databricks.com/aws/en/security/auth/single-sign-on/index.md#test-your-sso-configuration).

### SAML 2.0

1. As an account admin, log in to the [account console](https://accounts.cloud.databricks.com) and click **Security**.

2. Click the **Identity provider setup** tab.

3. In the **Authentication** section, configure single sign-on to open the SSO configuration dialog.

4. On the **Add details** step, under **Identity protocol**, select **SAML 2.0**.

5. Make note of the **Databricks redirect URL** value.

   ![Configure SAML SSO.](https://docs.databricks.com/aws/en/images/sso/saml-sso.png)

6. In another browser tab, create a Microsoft Entra ID application:
   1. Log in to Azure portal as an administrator.
   2. In the left navigation, click **Microsoft Entra ID > Enterprise applications**. The **All applications** pane opens and displays a random sample of the applications in your Microsoft Entra ID tenant.
   3. Click **New application**.
   4. Click **Create your own application**.
   5. Enter a name.
   6. Under **What are you looking to do with your application?** choose **Integrate any other application you don't find in the gallery**.

7. Configure the Microsoft Entra ID application:
   1. Click **Properties**.

   2. Set **Assignment required** to **No**. This option allows all users to sign in to the Databricks account.

   3. In the application's properties pane, click **Set up single sign on**.

   4. Click **SAML** to configure the application for SAML authentication. The SAML properties pane appears.

   5. Next to **Basic SAML configuration**, click **Edit**.

   6. Set **Entity ID** to the Databricks SAML URL you got from the Databricks SSO configuration page.

   7. Set **Reply URL** to the Databricks SAML URL you got from the Databricks SSO configuration page.

   8. Next to **SAML Signing Certificate**, click **Edit**.

   9. In the **Signing Option** drop-down list, select **Sign SAML response and assertion** and set the **Signing Algorithm** to **SHA-256** for enhanced security.

   10. In **Attributes & Claims**, click **Edit**.

   11. Set the **Unique User Identifier (Name ID)** field to `user.mail`.

   12. Under **SAML Certificates**, next to **Certificate (Base64)**, click **Download**. The certificate is downloaded locally as a file with the `.cer` extension.

   13. Open the `.cer` file in a text editor and copy the file contents. The file is the entire x.509 certificate for the Microsoft Entra ID SAML application.

       > [!IMPORTANT]
       >
       > * Do not open it using the macOS keychain, which is the default application for that file type in macOS.
       > * The certificate is sensitive data. Use caution about where to download it. Delete it from local storage as soon as possible.

   14. In the Azure portal, under **Set up Microsoft Entra ID SAML Toolkit**, copy and save the **Login URL** and **Microsoft Entra ID Identifier**.

8. Return to the SSO configuration dialog in the Databricks account console and enter the values you copied from Microsoft Entra ID:
   * **Single sign-on URL**: The Microsoft Entra ID **Login URL**
   * **Entity ID**: The Microsoft Entra ID **Microsoft Entra ID Identifier**
   * **x.509 certificate**: The Microsoft Entra ID x.509 certificate, including the markers for the beginning and end of the certificate

9. On the **Enable SSO** step, click **Enable SSO**. Databricks saves the configuration in a disabled state and runs a connection test. You are redirected to complete a sign-in with Microsoft Entra ID. If the test succeeds, SSO is enabled automatically. If the test fails, Databricks reports that it couldn't validate the configuration. Review the values you entered and try again.

10. After SSO is enabled, use the next-steps card to choose how to provision users from Microsoft Entra ID:
    * To automatically enable users from your identity provider, click **Configure** for Automatic Identity Management (AIM). See [Automatic identity management](https://docs.databricks.com/aws/en/admin/users-groups/automatic-identity-management/index.md).
    * To create user accounts the first time a user signs in, enable just-in-time (JIT) provisioning using the **Create new identities during first-time signup** toggle. See [Automatically provision users (JIT)](https://docs.databricks.com/aws/en/security/auth/jit.md).

For detailed post-setup testing guidance, including workspace login testing, see [Test your SSO configuration](https://docs.databricks.com/aws/en/security/auth/single-sign-on/index.md#test-your-sso-configuration).

## Add users to Databricks

After you configure SSO, add users to your account. Databricks recommends syncing users from your identity provider using automatic identity management, which syncs users and groups automatically from your identity provider to your Databricks account. See [Configure Microsoft Entra ID for automatic identity management](https://docs.databricks.com/aws/en/admin/users-groups/automatic-identity-management/ms-entra-id.md). Alternatively, if your identity provider does not support automatic identity management, you can configure SCIM provisioning. See [Sync users and groups from your identity provider using SCIM](https://docs.databricks.com/aws/en/admin/users-groups/scim/index.md).

Just-in-time (JIT) provisioning, which automatically adds users to Databricks when they first log in using SSO, is on by default for accounts created after May 1, 2025. See [Automatically provision users (JIT)](https://docs.databricks.com/aws/en/security/auth/jit.md).

## Enable unified login

For most accounts, unified login is already enabled, which means the account-level SSO configuration applies to all workspaces. If your account was created before June 21, 2023, you might need to enable it. See [Enable unified login](https://docs.databricks.com/aws/en/security/auth/single-sign-on/unified-login.md).

## <a id="claim" />Customize a claim to use for your account's usernames

By default, usernames in Databricks are represented as a user's email address. To assign usernames using a different value, configure a custom claim in your Microsoft Entra ID account.

Choose your identity protocol:

### OIDC

For OIDC applications, configure optional claims using the **Token configuration** page in your Microsoft Entra ID App Registration.

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as at least a Cloud Application Administrator.

2. Browse to **Identity > Applications > App registrations** and select the application you created for Databricks SSO.

3. In the sidebar, under **Manage**, click **Token configuration**.

4. Click **Add optional claim**.

5. For **Token type**, select **ID**.

6. Select the claim you want to include in the token (for example, `email`, `preferred_username`, or another available claim) and click **Add**.

   > [!NOTE]
   >
   > The list of available claims depends on your token version. If you need claims that aren't in the predefined list, use directory extension attributes or a custom claims provider. See [Configure optional claims](https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims) in the Microsoft Entra documentation.

7. If prompted to turn on the Microsoft Graph email permission, select the checkbox and click **Add**.

8. In the Databricks account console SSO configuration dialog, enter the claim name from step 6 in the **User attribute claim** field.

9. Click **Enable SSO** to save the configuration and run a connection test.

> [!WARNING]
>
> Some optional claims, such as `upn`, might not be included in tokens issued by certain Microsoft Entra ID token endpoints (for example, the v2.0 endpoint). If SSO fails after configuring a custom username claim:
>
> * Verify the claim is present in the ID token by inspecting it with [jwt.ms](https://jwt.ms).
> * See the [optional claims reference](https://learn.microsoft.com/en-us/entra/identity-platform/optional-claims-reference) for which claims are supported for each token version.

### SAML 2.0

For SAML applications, configure custom claims using the **Attributes & Claims** settings in your Microsoft Entra ID Enterprise Application.

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com) as at least a Cloud Application Administrator.
2. Browse to **Identity > Applications > Enterprise applications** and select the application you created for Databricks SSO.
3. In the sidebar, click **Single sign-on**.
4. In **Attributes & Claims**, click **Edit**.
5. Click **Add new claim**.
   * Enter a **Name** for the claim. This is the name you enter in the **User attribute claim** field of your Databricks SSO configuration.
   * For **Source**, select **Attribute**.
   * For **Source attribute**, select the desired Microsoft Entra ID attribute for this claim.
6. Click **Save**.
7. In the Databricks account console SSO configuration dialog, enter the claim name from step 5 in the **User attribute claim** field.
8. Click **Enable SSO** to save the configuration and run a connection test.
