IT and Development
Snowflake
9 min
snowflake is a cloud based data platform that provides data storage, processing, and analytic solutions with the snowflake app in {{product name}} you can execute sql commands and return results in your snowflake account requirements to use the snowflake app in {{product name}} , you must have a paid snowflake account for subscription information, refer to the snowflake pricing page connect snowflake and {{product name}} make provides three ways to connect the snowflake app snowflake /#establish a connection with usernamepassword snowflake /#establish a connection with a key pair snowflake /#establish a connection with an oauth establish a connection with username/password to connect your snowflake app with a username/password log in to your {{product name}} account, add a snowflake module to your {{scenario singular lowercase}} , and click create a connection optional in the connection name field, enter a name for the connection in the connection type , select the type of connection snowflake key pair optional in the connection name field, enter a name for the connection in the account field, enter your organization name and account name that you copied above in organization account format (e g , if your organization name is abc, and the account name is def > enter abc def) in the username and password fields, enter your snowflake account's login credentials in the database field, enter the name of the database for which you are going to execute commands to see the names of the current databases, in the left sidebar, click data > databases click save you've successfully created the connection and can now use the snowflake app in your {{scenario plural lowercase}} if you want to make changes to your connection in the future, follow the steps connect an application docid\ so88fm6pkt0g adkddfzz establish a connection with a key pair to connect your snowflake app with a key pair, you need to obtain your account details in your snowflake account and generate a private key to do that log in to your snowflake account at the bottom left, click your account name icon > view account details copy the account name and organization name and store them in a safe place to generate your private key in your snowflake account, refer to the snowflake documentation you need to generate both public and private keys to successfully connect snowflake in {{product name}} your public key is associated with your snowflake account, and your private key connects snowflake to {{product name}} you may generate either an encrypted or unencrypted private key if you generate an encrypted key, store your password in a safe place log in to your {{product name}} account, add a snowflake module to your scenario, and click create a connection in the connection type , select the type of connection snowflake key pair optional in the connection name field, enter a name for the connection in the account field, enter your organization name and account name that you copied above in organization account format (e g , if your organization name is abc, and the account name is def > enter abc def) in the username field, enter your snowflake user login in the private key field, enter the private key you generated in your snowflake account in the database field, enter the name of the database for which you are going to execute commands to see the names of the current databases, in the left sidebar, click data > databases click save you've successfully created the connection and can now use the snowflake app in your {{scenario plural lowercase}} if you want to make changes to your connection in the future, follow the steps connect an application docid\ so88fm6pkt0g adkddfzz establish a connection with an oauth to connect your snowflake app with the oauth client credentials, you need to obtain your client id, client secret, and account identifier in your snowflake account to do that log in to your snowflake account you need an accountadmin role or a role with the global create integration privilege to obtain the client credentials, you need to create a security integration in the left sidebar, click the + icon > sql worksheet this is where you can write and execute sql queries create an integration for a custom client here's an example of the sql statement click the run button in the top right corner to execute the command and create the security integration make sure the statement is executed without errors this is a minimal set of data to specify prior to the query execution for additional details and configuration options, refer to snowflake oauth documentation to view the complete configuration of the app you just created, use this sql statement describe integration "your integration name"; to let users with privileged roles create a connection, execute the following sql statement alter account set oauth add privileged roles to blocked list = false to retrieve the oauth client id and oauth client secret, run the following sql query after executing the command, you will see a json string at the bottom of the worksheet it contains your oauth client id, and oauth client secret copy the oauth client id and oauth client secret, and store them in a safe place to obtain the account identifier , click your account name icon > view account details copy the account identifier and store it in a safe place log in to your make account, add a snowflake module to your scenario, and click create a connection in the connection type , select the type of connection snowflake oauth optional in the connection name field, enter a name for the connection in the client id field, enter the oauth client id you copied in snowflake in the client secret field, enter the oauth client secret you copied in snowflake in the account identifier field, enter the account identifier that you copied above in the database field, enter the name of the database for which you are going to execute commands to see the names of the current databases, in the left sidebar, click data > databases click save you've successfully created the connection and can now use the snowflake app in your {{scenario plural lowercase}} if you want to make changes to your connection in the future, follow the steps connect an application docid\ so88fm6pkt0g adkddfzz if you switch from one authentication method to another, you can create a new connection with that authentication method and then replace the old one in all scenarios where it’s used see the instructions here snowflake modules after connecting to the snowflake app, you can use the following types of modules to build your {{scenario plural lowercase}} actions execute sql templates you can look for snowflake templates in make's template gallery , where you'll find thousands of pre created {{scenario plural lowercase}} for different apps snowflake resources snowflake api documentation