- Search Snowflake with SQL
- Search Snowflake with Cortex
Action Pack setup instructions
Update Snowflake network policy
If your Snowflake instance has network policies configured, you will need to update them to allow connections from Glean. Without this configuration, the actions will not work. Please reach out to your Glean representatives to get the IP addresses that need to be added to your network policy allowlist.Set up a role to use
Option 1: Create a new Snowflake role with read-only access
A role is basically a group that grants specific permissions on certain resources. You may grant a role to a user or to another role (nested roles). First, we will create a new role called GLEAN_QUERY_SNOWFLAKE_ROLE. To do this, run the following queries with the ACCOUNTADMIN role or any role that can create roles and grant access to resources such as tables and Cortex:Option 2: Use an existing Snowflake role with read-only access
You can also use an existing role in the Scopes field when setting up your Action Pack. The action would use the access that the specified role has on your Snowflake instance. For example, your Scopes field could look like:Option 3: Use default user primary role
To use the default primary Snowflake role assigned to the authenticated user, set the Scopes field to justrefresh_token.
Create a Snowflake OAuth application
We will use the CREATE SECURITY INTEGRATION command to create the OAuth application. Use the ACCOUNTADMIN or any role that has permission to create a security integration:Using secondary roles: If you want users to also leverage their default secondary roles, you can configure the security integration with
OAUTH_USE_SECONDARY_ROLES = IMPLICIT during setup. This allows the action to utilize multiple roles that have been granted to the user.Create Snowflake action pack
We will now set up the Snowflake action pack:- Open Glean Settings page
- Go to Platforms > Actions
- Click on Add button for creating a new action
- Click on the Snowflake Actions box
- Populate the Configuration section
-
Set the account identifier field in the configuration. You may set it to the account identifier or account locator. This information can be found by navigating to the account details:

The accountIdentifier is the part before
.snowflakecomputing.comin your Snowflake URL. For example, if your URL ishttps://abc12345.us-east-1.snowflakecomputing.com, the account identifier isabc12345.us-east-1. -
For the Authorization url and Token url, run the following command in Snowflake to retrieve these values:
Look for the
OAUTH_AUTHORIZATION_ENDPOINTandOAUTH_TOKEN_ENDPOINTfields in the response:
- Set the OAuth client id and client secret obtained from the previous step.
-
Set the account identifier field in the configuration. You may set it to the account identifier or account locator. This information can be found by navigating to the account details:
- Save the action.
