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

# Databricks Lakebase

export const title_1 = "Databricks Lakebase";

export const title_0 = "Databricks Lakebase";

## Prerequisites

To use the OAuthClient authentication method, you must create a service principal in Databricks Lakebase and assign permissions. Refer to the [Databricks documentation](https://docs.databricks.com/aws/en/admin/users-groups/manage-service-principals).

Next, the account or workspace administrator creates an OAuth secret:

<Steps>
  <Step>
    At the new service principal's details page, in the **Developer Service Principal** section, click the **Secrets** tab.
  </Step>

  <Step>
    Under OAuth secrets, click the **Generate secret** button.
  </Step>

  <Step>
    Enter the desired lifetime for the secret in days, up to a maximum of 730 days (two years). The admin console displays updated details about the new service principal, including the OAuth secret and the Client ID (which is the same as the service principal's application ID).
  </Step>

  <Step>
    Enter the Client Id and Secret in the fields below.
  </Step>
</Steps>

## Setup Guide

Follow these steps to connect Databricks Lakebase to your Connect AI account:

<Steps>
  <Step>
    Open the **Sources** page of the Connect AI navigation menu.
  </Step>

  <Step>
    Click **+ Add Connection** in the upper-right corner.
  </Step>

  <Step>
    Type *Databricks Lakebase* into the search field, then click the data source name.
  </Step>

  <Step>
    On the **Basic Settings** tab of the new connection, enter a connection name or keep the default name.
  </Step>

  <Step>
    Enter the host name or IP address of the **Server** name hosting the Databricks Lakebase database.
  </Step>

  <Step>
    Enter the name of the target Databricks Lakebase **Database**.
  </Step>

  <Step>
    For **Databricks Instance**, enter the URL for the user interface during normal access of the Databricks console. This should be in the format of `dbc-(id).cloud.databricks.com`.
  </Step>

  <Step>
    Enter the **Port** number of the server hosting the Databricks Lakebase database. The default value is 5432.
  </Step>

  <Step>
    Select the Authentication method, then proceed to the relevant section and follow those instructions.
  </Step>
</Steps>

## Authentication Methods

<Tabs>
  <Tab title="OAuthClient">
    <Steps>
      <Step>
        Enter the **OAuthClientId** assigned when you configured the service principal (in the prerequisites).
      </Step>

      <Step>
        Enter the **OAuthClientSecret** assigned when you configured the service principal (in the prerequisites). This value authenticates the application to the OAuth authorization server.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_0} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>

  <Tab title="OAuthPKCE">
    <Steps>
      <Step>
        Enter the **User** Id of the authenticating user. The user obtains a temporary code from the authorization server.
      </Step>

      <Step>
        At the top of the Connect AI **Add {title_1} Connection** page, click **Save & Test**.

        * If the connection test succeeds, a **Connection successfully saved** message appears, indicating that your connection has been created. The **Status** on the **Edit Connection** page also changes to **Authenticated**. View the data model of your successful connection in the right pane of the **Edit Connection** page, in the **Data Model** tab.
        * If the connection test fails, ensure that you entered your login information correctly with no stray spaces or other characters. Connect AI displays error messages under the required fields with missing data. Some data sources require that you sign in directly to the source website. If you did not, an error message appears under the **Sign in** button. Correct the errors and try again.
        * Unsuccessful connections are saved as drafts and have a **Status** of **Not Authenticated**. You can return to the connection and authenticate it later.
      </Step>
    </Steps>
  </Tab>
</Tabs>

## More Information

For more information about interactions between Connect AI and Lakebase, see [this information page](https://cdn.cdata.com/help/LSM/cloud/default.htm#default).
