Set up the Openflow Connector for Google Drive without domain-wide delegation (Preview)¶
This topic describes how to set up these catalog variants:
- Google Drive (Simple Ingest, No Domain-wide authority, no ACLs) ingests files into a Snowflake stage.
- Google Drive (Cortex Connect, No Domain-wide authority, no ACLs) indexes files in Snowflake Cortex Search.
Both variants ingest files from a Google Workspace Shared Drive. They don’t ingest permissions (ACLs), and they don’t require domain-wide delegation. You don’t configure OAuth scopes in the Google Admin Console. The service account authenticates with its own credentials and reaches the Shared Drive through direct membership.
If you installed Google Drive (Simple Ingest) or Google Drive (Cortex Connect), which require domain-wide delegation, use Set up the Openflow Connector for Google Drive instead.
Prerequisites¶
- Ensure that you have reviewed About Openflow Connector for Google Drive.
- Ensure that you have Set up Openflow - Snowflake Deployments or Set up Openflow - BYOC.
- If using Openflow - Snowflake Deployments, ensure that you’ve reviewed configuring required domains and have granted access to the required domains for the Google Drive connector.
Get the credentials¶
You need a Google Cloud service account, the Google Drive API enabled in that project, and the service account added as a member of the Shared Drive you want to ingest.
You don’t need Super Admin access, domain-wide delegation, or OAuth scopes in the Google Admin Console.
Enable service account key creation¶
By default Google disables service account key creation. For Openflow to use the service account JSON, this key creation policy must be turned off.
- Log in to the Google Cloud Console with an account that can manage organization policies, if key creation is disabled for your organization.
- In the resource selector, make sure you’re in the organization, not a project in the organization.
- Select Organization Policies.
- Select the Disable service account key creation policy.
- Select Manage Policy and turn off enforcement.
- Select Set Policy.
Create a service account and key¶
- Open the Google Cloud Console and authenticate using a user that has been granted access to create service accounts.
- Make sure you’re in a project in your organization.
- In the left navigation, under IAM & Admin, select the Service Accounts tab.
- Select Create Service Account.
- Enter the service account name and select Create and Continue.
- Select Done. Copy the service account email. You use it when you add the account as a member of the Shared Drive.
- On the newly created service account, select the menu under the table with the service accounts listed for that service account and select Manage keys.
- Select Add key and then Create new key.
- Leave the default selection of JSON and select Create.
The key is downloaded into your browser Downloads directory as a .json
file.
Enable the Google Drive API¶
In the Google Cloud Console, enable the Google Drive API for the project that contains the service account.
Add the service account to the Shared Drive¶
- Open Google Drive and go to the Shared Drive that you want to ingest.
- Add the service account email as a member of that Shared Drive.
The service account authenticates with its own credentials. Access to the drive comes from this membership, not from domain-wide delegation.
Set up Snowflake account¶
These steps apply to both variants. If you installed Google Drive (Cortex Connect, No Domain-wide authority, no ACLs), also grant the Cortex Search privileges in the procedure below. That section applies when you ingest files and perform processing with Cortex.
As an Openflow administrator, perform the following tasks to set up your Snowflake account. With the
default SNOWFLAKE_MANAGED authentication strategy, the runtime’s execute-as role is the identity
the connector uses to access Snowflake, so you grant it the following privileges.
Note
If you’re deploying the connector in Openflow - BYOC Deployments and using the KEY_PAIR authentication
strategy instead of the recommended SNOWFLAKE_MANAGED, you’ll also grant this same execute-as
role to a service user rather than relying on the runtime’s managed token. See
Set up key-pair authentication for Openflow - BYOC Deployments
to create the service user.
Create database, schema, and warehouse¶
-
Create the destination database:
-
Create the destination schema:
-
Grant the required privileges to the runtime’s execute-as role:
-
Create a warehouse (or use an existing one) and grant usage privileges:
-
If any other Snowflake users require access to the raw documents and tables ingested by the connector (for example, for custom processing in Snowflake), grant those users the execute-as role.
Grant Cortex Search privileges¶
If you’re using the connector for the use case Ingest files and perform processing with Cortex, also perform the following tasks:
-
Create a role for read access to the Cortex Search service created by this connector, and grant it to any role that will use the service:
-
Grant the privilege to create the Cortex Search service, and grant the read-only role access to the database and schema:
Install and configure the connector¶
As a data engineer, perform the following tasks to install and configure the connector:
Install the connector¶
In the connector library, install one of these variants:
- Google Drive (Simple Ingest, No Domain-wide authority, no ACLs)
- Google Drive (Cortex Connect, No Domain-wide authority, no ACLs)
Don’t install Google Drive (Simple Ingest) or Google Drive (Cortex Connect). Those variants require domain-wide delegation.
To install the connector, do the following as a data engineer:
-
Navigate to the Connector library tab in Openflow.
-
On the Openflow connectors page, find the connector and select Install.
-
In the Select runtime dialog, select your runtime from the Available runtimes drop-down list and click Install.
Note
Before you install the connector, ensure that you have created a database and schema in Snowflake for the connector to store ingested data.
-
Authenticate to the deployment with your Snowflake account credentials and select Allow when prompted to allow the runtime application to access your Snowflake account. The connector installation process takes a few minutes to complete.
-
Authenticate to the runtime with your Snowflake account credentials.
The Openflow canvas appears with the connector process group added to it.
Configure the connector¶
- Right-click the imported process group and select Parameters.
- Enter the required parameter values as described in Source parameters, Destination parameters, and Ingestion parameters. If you installed Google Drive (Cortex Connect, No Domain-wide authority, no ACLs), also set Additional parameters for Cortex Connect.
Source parameters¶
| Parameter | Description |
|---|---|
| GCP Service Account JSON | The service account JSON downloaded from Google Cloud Console to allow access to Google APIs in the connector |
If the process group shows Google Delegation User, leave it unset. These variants authenticate as the service account and don’t impersonate a Google Workspace user.
Destination parameters¶
| Parameter | Description | Required |
|---|---|---|
| Destination Database | The database where data will be persisted. It must already exist in Snowflake. The name is case-sensitive. For unquoted identifiers, provide the name in uppercase. | Yes |
| Destination Schema | The schema where data will be persisted, which must already exist in Snowflake. The name is case-sensitive. For unquoted identifiers, provide the name in uppercase. See the following examples:
| Yes |
| Snowflake Authentication Strategy | When using:
| Yes |
| Snowflake Account Identifier | When using:
| Yes |
| Snowflake Private Key | When using:
| No |
| Snowflake Private Key File | When using:
| No |
| Snowflake Private Key Password | When using:
| No |
| Snowflake Role | When using:
| Yes |
| Snowflake Username | When using:
| Yes |
| Snowflake Warehouse | Snowflake warehouse used to run queries. | Yes |
Ingestion parameters¶
| Parameter | Description |
|---|---|
| Google Drive ID | The Google Shared Drive to watch for content and updates |
| Google Folder Name | Optionally, the Google Drive folder identifier (human-readable folder name) can be set to filter incoming files by. If all files are desired, then select “Set Empty String”. When set, the connector retrieves only files that are in the provided folder or subfolder. When blank or unset, no folder filtering is applied and all files under the drive are retrieved. |
| File Extensions To Ingest | A comma-separated list that specifies file extensions to ingest. The extension check is performed on the original file extension. |
| Snowflake File Hash Table Name | Internal table used to store file content hashes to prevent updates to content when it has not changed. |
If the process group shows Google Domain, leave it unset. These variants don’t resolve Google Groups or ingest ACLs.
Additional parameters for Cortex Connect¶
If you installed Google Drive (Cortex Connect, No Domain-wide authority, no ACLs), also set these parameters. The connector tries to convert files to PDF before it checks File Extensions To Ingest. If a listed extension isn’t supported by Cortex Parse Document, the connector skips that file, logs a warning, and continues.
| Parameter | Description |
|---|---|
| OCR Mode | The OCR mode to use when parsing files with the Parsing documents with AI_PARSE_DOCUMENT function. The value can be OCR or LAYOUT. |
| Snowflake Cortex Search Service User Role | An identifier of a role that is assigned usage permissions on the Cortex Search service. |
Run the flow¶
- Right-click the canvas and select Enable all Controller Services.
- Right-click the imported process group and select Start. The connector starts the data ingestion.
Finding files in stage¶
Files stored in the stage might have unreadable names. To find specific files, use the metadata tables as your source of truth. These tables contain the mapping between file names and their corresponding file IDs in the stage.
Replace <file_name> with the name or partial name of the file you’re looking for.
The files in the stage start with the ID returned from this query.