Configure OAuth for HubSpot ingestion
Learn how to configure HubSpot for ingestion from HubSpot Marketing Hub into Databricks. The managed HubSpot connector in Lakeflow Connect uses OAuth 2.0 user-to-machine (U2M) authentication. Use the authentication details that you retrieve from the steps on this page to create a Unity Catalog connection in Databricks.
HubSpot retired the legacy public app creation UI. Create your app using HubSpot's project-based platform and the HubSpot CLI, as described on this page. See the HubSpot changelog for details.
Install and authenticate the HubSpot CLI
-
Install Node.js version 20 or above.
-
Install the HubSpot CLI:
Bashnpm install -g @hubspot/cli -
Authenticate the CLI with your HubSpot account:
Bashhs account authFollow the prompts to generate a personal access key and save it to your local CLI configuration.
Create an app and retrieve authentication details
-
Create an app on HubSpot's project-based platform:
Bashhs project create --project-base app --auth oauth --distribution private -
In the generated
app-hsmeta.jsonfile, setauth.redirectUrlsto your workspace's redirect URL (format:https://<your_workspace_domain>/login/oauth/lakehousefederation.html). For example:https://e2.our-staging-workspace.cloud.databricks.com/login/oauth/lakehousefederation.html -
In the same file, set
auth.requiredScopesto only the following scopes. Omitting any of these or adding additional scopes will cause failures later in the setup process.oauthcommunication_preferences.readcontentcrm.objects.marketing_events.readcrm.objects.marketing_events.writeformsforms-uploaded-filesmarketing.campaigns.read
-
Deploy the app to your HubSpot account:
Bashhs project upload -
Retrieve the app's authentication details:
Bashhs project openUnder Project Components, select your app, then click the Auth tab. Note the Client ID and the Client secret. Use these to create a Unity Catalog connection in Databricks.
-
Install the app in your HubSpot account:
- Go to Development > Projects.
- Select your project, then select your app.
- On the Distribution tab, click Install now and authorize the app.
Migrate a legacy app
If you already have a legacy public app configured for HubSpot ingestion, migrate it to the project-based platform instead of creating a new app. Migration preserves your app's existing Client ID, Client secret, and installs, so you don't need to update your Unity Catalog connection.
-
Update the HubSpot CLI to version 7.6.0 or later:
Bashnpm install -g @hubspot/cli@latest -
Run the migration command and follow the prompts to select your app and confirm the components to migrate:
Bashhs app migrate
For details, see HubSpot's migration guide.
Next steps
Use Catalog Explorer to create a connection so that any user with USE CONNECTION or ALL PRIVILEGES can create pipelines. See Create a HubSpot connection.