Skip to main content

Snowflake Connector

Snowflake Snowflake is a cloud data platform. Use the Snowflake component to access and update data in a Snowflake Database.

Connections

Snowflake Key Pair Authentication

Use this connection if you want to connect to Snowflake via their Key Pair Authentication.

Set up key-pair authentication. For more information refer to the following guide.

As part of this process, you must:

  1. Generate a public-private key pair. The generated private key should be in a file (e.g. named rsa_key.p8).
  2. Assign the public key to your Snowflake user. After you assign the key to the user, run the DESCRIBE USER command. In the output, the RSA_PUBLIC_KEY_FP property should be set to the fingerprint of the public key assigned to the user.
InputCommentsDefault
Private KeyThe private key for the Snowflake Key Pair Authentication.
Snowflake UsernameYour Snowflake username.
Account IdentifierYou can find the account identifier in the organization's account panel https://docs.snowflake.com/en/user-guide/admin-account-identifier
PassphraseThe passphrase for the provided private key (Required).

Snowflake OAuth 2.0

Snowflake OAuth 2.0 Authentication.

Snowflake will use OAuth 2.0 for authentication and making API calls on behalf of customers.

Follow these steps to set up an OAuth integration on your snowflake. More information for these steps can be found here https://docs.snowflake.com/en/user-guide/oauth-custom

  1. Login to Snowflake and create a worksheet to set a new integration.
  2. Create a new security integration by copying the following SQL statement into Snowflake and selecting the Play button at the top right of the screen. Make sure to change the INTEGRATIONNAME to something you will remember
CREATE SECURITY INTEGRATION
INTEGRATIONNAME
TYPE = OAUTH
OAUTH_CLIENT = CUSTOM
OAUTH_REDIRECT_URI = 'https://oauth2.your-domain.com/callback'
OAUTH_CLIENT_TYPE = 'PUBLIC'
  1. Run The following SQL statement to get your Auth URL, Token URL, and Client ID. Change INTEGRATIONNAME to the name you used during the create statement.
DESCRIBE INTEGRATION INTEGRATIONNAME
  1. Run the following SQL statement to get your Client Secret.

    a. Its important that you use the secret listed as AUTH_CLIENT_SECRET from the return

SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('INTEGRATIONNAME')
  1. Run the following SQL statement to enable the Integration.
ALTER SECURITY INTEGRATION INTEGRATIONNAME SET ENABLED = TRUE
  1. Enter your Authorization URL, Token URL, Client ID, and Client Secret.

    a. Once attempting to authenticate its important to note that users with the roles of ACCOUNTADMIN, SECURITYADMIN, and ORGADMIN will receive an “invalid consent request error” message as snowflake blocks these roles by default. We suggest authenticating with a different user without these roles assigned.

This connection uses OAuth 2.0, a common authentication mechanism for integrations. Read about how OAuth 2.0 works here.

InputCommentsDefault
Authorize URLThe OAuth 2.0 Authorization URL for the API
Token URLThe OAuth 2.0 Token URL for the API
ScopesSpace separated OAuth 2.0 permission scopes for the API
Client IDClient Identifier of your app for the API
Client SecretClient Secret of your app for the API
HeadersAdditional header to supply to authorization requests

Actions

Execute SQL

Executes one or more SQL statements in your Snowflake DB.

InputCommentsDefault
Connection
SQL statements to run
Snowflake Identifier URLThe Snowflake URL for you account. Has to have the format: https://.snowflakecomputing.com
Account LocatorYou can find the account locator in the organization's account panel or https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-region-and-locator-for-an-account
Number of statements to execute0 Indicates that a variable number of statements can be included in the request.
TimeoutTimeout in seconds for statement execution. If the execution of a statement takes longer than the specified timeout, the execution is automatically canceled.
DatabaseDatabase in which the statement should be executed.
SchemaSchema in which the statement should be executed.
WarehouseWarehouse to use when executing the statement.
RoleRole to use when executing the statement.
BindingsValues of bind variables in the SQL statement. Bindings should have this format:
ParametersSession parameters that you want to set for this request. Parameters should have this format:
Poll for asynchronous resultsIf true, action will handle polling for results on queries that take > 45 seconds to execute, If false, action will return immediately after executing the query.false
Debug RequestEnabling this flag will log out the current request.false

Get Statement Handle

Retrieve the current status of a executed statement from Snowflake.

InputCommentsDefault
Connection
Snowflake Identifier URLThe Snowflake URL for you account. Has to have the format: https://.snowflakecomputing.com
Account LocatorYou can find the account locator in the organization's account panel or https://docs.snowflake.com/en/user-guide/admin-account-identifier#finding-the-region-and-locator-for-an-account
Statement Handle IDThe ID of the statement handle.
PartitionThe partition number to retrieve.
Debug RequestEnabling this flag will log out the current request.false