Skip to main content

Set up Google Drive for managed ingestion

Beta

This feature is in Beta. Workspace admins can control access to this feature from the Previews page. See Manage Databricks previews.

This page describes how to configure OAuth 2.0 on Google Cloud for the managed Google Drive connector in Lakeflow Connect. After completing these steps, follow the instructions in Google Drive to create a Unity Catalog connection.

Prerequisites

Before you configure the Google Drive data source, you must have:

  • A Unity Catalog-enabled workspace.
  • A Google account with the necessary permissions to create a Google Cloud project.
  • The CREATE CONNECTION privilege on the metastore, or an existing Google Drive connection shared with you.

Set up a Google Cloud project and enable the Google Drive API

  1. Go to the Google Cloud console.
  2. Create a new project. You might be prompted to set up two-factor authentication.
  3. Go to APIs & Services > Library.
  4. Search for "Google Drive API".
  5. Select Google Drive API.
  6. Select Enable.
  1. On the Google Cloud console home screen, go to APIs & Services > OAuth Consent Screen. You will see a message that says "Google Auth Platform not configured yet".

  2. Select Get Started.

  3. Fill in the App Information section. Enter any name for the app name (for example, Databricks connection). The support email can be any email in your organization.

  4. Select Next.

  5. In the Audience section, select External, then select Next.

  6. Fill in the Contact Information section, then select Next.

  7. Review the Google API Services User Data Policy, then select Create.

  8. Go back to Google Auth Platform > Data Access.

  9. Select Add or remove scopes.

  10. Add the following scope in the Manually add scopes section, select Add to table, then select Update:

    https://www.googleapis.com/auth/drive.readonly

  11. Select Save.

Create OAuth 2.0 client credentials

  1. On the Google Cloud console home screen, go to APIs & Services > Credentials.
  2. Select Create Credentials > OAuth Client ID.
  3. Choose Web Application and set a custom name.
  4. In Authorized Redirect URIs, select Add URI.
  5. Add a redirect URI to <databricks-instance-url>/login/oauth/google.html, replacing <databricks-instance-url> with your Databricks instance URL. For example: https://instance-name.databricks.com/login/oauth/google.html
  6. Select Create. A dialog with your credentials appears.
  7. Record the following values. Alternatively, you can download the OAuth Client JSON file, which contains this information:
    • Client ID (format: 0123******-********************************.apps.googleusercontent.com)
    • Client secret (format: ABCD**-****************************)

Add test users

  1. Go to Google Auth Platform > Audience.
  2. Under Test users, select Add users.
  3. Add the email address of the Google account you will use to create the connection.

Next steps

Use the client ID and client secret from Create OAuth 2.0 client credentials and the Google account from Add test users to create a Unity Catalog connection. See Google Drive.