Make sure that Snowpipe Streaming is enabled in the Snowflake account.
Also, because the Snowflake target connection uses key pair authentication, you must generate the public and private key pair using OpenSSL. The key pair authentication method requires a 2048-bit RSA key pair. Later, when you configure Snowflake connection properties, you'll need to specify the path to the private key file and password.
To configure key pair authentication, you must have the SecurityAdmin role or higher.
Perform the following steps:
1Create a replication user. Use the following SQL statement:
create user INFACMI_User password 'Xxxx@xxx';
2Create a new user role and grant it to the user. Use the following SQL statements:
create role INFACMI_snowpipe; grant role INFACMI_snowpipe to user INFACMI_User;
3Grant usage on the Snowflake virtual warehouse to the new role. Use the following SQL statement:
grant usage on warehouse warehouse_name to role INFACMI_snowpipe;
4Grant usage on the Snowflake database to the new role. Use the following SQL statement:
grant usage on database INFACMI_DB1 to role INFACMI_snowpipe;
5Create a new schema. Use the following SQL statements:
use database INFACMI_DB1; create schema sh_snowpipe;
6Grant create stream, create view, and create table privileges on the new Snowflake schema to the new role. Use the following SQL statement:
grant create stream, create view, create table, usage on schema INFACMI_DB1.sh_snowpipe to role INFACMI_snowpipe;
7Set the default role for the newly created user. Use the following SQL statement:
alter user INFACMI_User set default_role=INFACMI_snowpipe;
8When you define a connection to the Snowflake target, use the KeyPair option as the authentication method.
9Generate a private key with OpenSSL version 3.x.x and the PBE-SHA1-2DES or PBE-SHA1-3DES cipher. Use the following openssl commands to generate and format the private key:
10Generate the public key. Use the following openssl command, in which the -in option references the file (rsa_key.p8) that contains the encrypted private key: