Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Login to your Snowflake account and switch role to ACCOUNTADMIN.

...

  • Click on Account tab.

  • Go to Roles tab and click on Create icon.

  • Create a Role by entering a Name and selecting Parent Role, then click Finish.

2. Create User

  • Go to Users tab and click on Create icon.

  • In General section enter User Name and Password details. ZILLAREADERUSER is an example, you can choose any name you want. Note down the User Name for later steps. Click Next.

  • In Advanced section fill in the details, see Note below.


    Note: Login Name should be the User Name provided in the General section, Email should be an email address from your organization, zillareaderuser@example.com is just an example. Click Next.

  • In Preferences section, select the role created in step 1 “1. Create Role” section above as Default Role and click Finish.

3. Create Key Pair Authentication for the User

...

a. Generate the Private Key

To generate an unencrypted version, use the following command:

...

$ openssl genrsa 2048 | openssl pkcs8 -topk8 -inform PEM -out rsa_key.p8

...

b. Generate a Public Key

$ openssl rsa -in rsa_key.p8 -pubout -out rsa_key.pub

...

c. Store the Private and Public Keys Securely: Store these sensitive keys securely so that no one can access them.

...

d. Assign the Public Key to the Snowflake User (e.g., ZILLAREADERUSER) created in

...

“2. Create User” section above, with the following SQL query:

Code Block
// Execute this query to enable admin privilege so that we can modify user
USE ROLE ACCOUNTADMIN;

...

  • Execute the following query substituting user created in step 2 “2. Create User” section above for ZILLAREADERUSER and the public key, see Note below:

Code Block
// Make change to user to associate RSApublic key
ALTER USER ZILLAREADERUSER SET RSA_PUBLIC_KEY='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC........;

...

  • Navigate to the Warehouses tab and Select your Warehouse. Click on Grant Privileges.

...

  • Enter the Privileges to grant as USAGE and Grant privileges to role (ZILLAREADERROLE). Click Grant.

5. Give the DATABASE Grant Privileges to Role (ZILLAREADERROLE)

  • Navigate to the Worksheets tab. Write the following query on a worksheet. To summarize, this SQL statement creates a new database that contains views that pull from the primary Snowflake Database. The role and user are only granted access to these views in the new database. Substitute ZILLAREADERUSER with the User Name created in step 2 above “2. Create User” section.

Code Block
use role ACCOUNTADMIN;

use warehouse ZILLA;

create database ZILLA_SNOWFLAKE_USAGE;

create schema ZILLA_SNOWFLAKE_USAGE.ACCOUNT_USAGE;



create view ZILLA_SNOWFLAKE_USAGE.ACCOUNT_USAGE.USERS 
    as select 

...

USER_ID,NAME,CREATED_ON,DELETED_ON,LOGIN_NAME,DISPLAY_NAME,FIRST_NAME,LAST_NAME,EMAIL,MUST_CHANGE_PASSWORD,HAS_PASSWORD,COMMENT,DISABLED,SNOWFLAKE_LOCK,DEFAULT_WAREHOUSE,DEFAULT_NAMESPACE,DEFAULT_ROLE,EXT_AUTHN_DUO,EXT_AUTHN_UID,BYPASS_MFA_UNTIL,LAST_SUCCESS_LOGIN,EXPIRES_AT,LOCKED_UNTIL_TIME,HAS_RSA_PUBLIC_KEY,PASSWORD_LAST_SET_TIME,OWNER,DEFAULT_SECONDARY_ROLE from SNOWFLAKE.ACCOUNT_USAGE.USERS;

create view ZILLA_SNOWFLAKE_USAGE.ACCOUNT_USAGE.GRANTS_TO_USERS 
    as select 

...

CREATED_ON,DELETED_ON,"ROLE",GRANTED_TO,GRANTEE_NAME,GRANTED_BY from SNOWFLAKE.ACCOUNT_USAGE.GRANTS_TO_USERS;
    

grant usage on warehouse ZILLA to role ZILLAREADERROLE;
grant usage on database ZILLA_SNOWFLAKE_USAGE to role ZILLAREADERROLE;
grant usage on schema ZILLA_SNOWFLAKE_USAGE.ACCOUNT_USAGE to role ZILLAREADERROLE;    


grant select on view ZILLA_SNOWFLAKE_USAGE.ACCOUNT_USAGE.USERS to role ZILLAREADERROLE;
grant select on view ZILLA_SNOWFLAKE_USAGE.ACCOUNT_USAGE.GRANTS_TO_USERS to role ZILLAREADERROLE;

grant role ZILLAREADERROLE to user ZILLAREADERUSER;

...

...

Set up Snowflake Application Integration on Zilla:

  • Navigate to your Snowflake instance in your libraryVisit the Zilla application and login using your admin credentials and then click Add Applicationin the top right.

...

  • A window with a search bar appears, type in snowflake in the search bar. Snowflake application entry will appear at the top of the list, click Add to Applications button to the right.

...

  • Fill in the form with appropriate details and then click Add to Applications button.

...

  • A detailed view of Snowflake application appears. Click Sync now or the gear icon in the top right corner .This pop-up should appear, click on the slider below API Integration to enable it.

    Image Removed

    to configure your application.

...

  • Enable API Integration option from the dialog.

...

  • Add the configuration details, check the information below this screenshot.

    image-20240607-071555.pngImage Added

  • Here fill in the details as follows,

    • RSA Private Key: The PVT RSA key generated in step 3 section “3. Create Key Pair Authentication for the Userabove. You can print the key on the terminal using $cat rsa_key.p8 command. Note that key shall be copied with -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- otherwise app will throw an error. Paste the key in the input box.

    • RSA Private Key Passphrase: If you created an encrypted RSA PVT key then a passphrase to decrypt the key shall be provided here. If you have not created an encrypted key using -nocrypt flag, leave this blank.

    • Snowflake Account Id: If your snowflake URL is https://unaXXXXX.us-east-1.snowflakecomputing.com/ then unaXXXXX.us-east-1 is your account id.

    • Account Username: In our case, it’s ZILLAREADERUSER. If you have chosen a custom name above, provide that name.

    • Account User Role: In our case, it’s ZILLAREADERROLE. If you have chosen any custom role name above, provide that name.

    • Warehouse name ( Where SNOWFLAKE db & ACCOUNT_USAGE schema is located ): Warehouse name: Name of the warehouse which has the SNOWFLAKE database & ACCOUNT_USAGE schema. Use show warehouses; command to see available warehouses in your account.

  • After Click Next/Sync Now after filling in the above details click on Next.You will see a configuration stored success toast as well as a small dialog saying In the next step, you will be asked to log in to Snowflake, and then the data sync will start automatically. Click Next.config details

...

  • Click Next on the below screen

...

  • Click Done.

...

  • Check sync summary and click Close.

...

Include Page
Integrations Footer
Integrations Footer