Skip to content

Commit

Permalink
NB: Upadte Snowflake docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Skynet committed Sep 14, 2023
1 parent 5f8f03b commit d7c0aaf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dlt/helpers/dbt/profiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ snowflake_pkey:
role: "{{ env_var('DLT__CREDENTIALS__ROLE', '') }}"
schema: "{{ var('destination_dataset_name', var('source_dataset_name')) }}"
warehouse: "{{ env_var('DLT__CREDENTIALS__WAREHOUSE', '') }}"
private_key: "{{ env_var('DLT__CREDENTIALS__PRIVATE_KEY') }}"
private_key: "{{ env_var('DLT__CREDENTIALS__PRIVATE_KEY') }}" # base64 encoded private key
private_key_passphrase: "{{ env_var('DLT__CREDENTIALS__PRIVATE_KEY_PASSPHRASE', '') }}"
threads: 4

Expand Down
13 changes: 5 additions & 8 deletions docs/website/docs/dlt-ecosystem/destinations/snowflake.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,21 @@ You can also pass credentials as a database connection string. For example:
destination.snowflake.credentials="snowflake://loader:<password>@kgiotue-wn98412/dlt_data?warehouse=COMPUTE_WH&role=DLT_LOADER_ROLE"
```

In **key pair authentication** you replace password with a private key exported in PEM format. The key may be encrypted. In that case you must provide a passphrase.
In **key pair authentication** you replace password with a private key string that should be in Base64-encoded DER format, representing the key bytes. The key may be encrypted. In that case you must provide a passphrase.
```toml
[destination.snowflake.credentials]
database = "dlt_data"
username = "loader"
host = "kgiotue-wn98412"
private_key = """-----BEGIN ENCRYPTED PRIVATE KEY-----
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDz5LZoccgKZ4jH
...
-----END PRIVATE KEY-----
private_key = "LS0tLS1CRUdJTiBFTkNSWVBURUQgUFJJ....Qo="
private_key_passphrase="passphrase"
"""
```
> You can easily get the base64-encoded value of your private key by running `base64 -i <path-to-private-key-file>.pem` in your terminal
We allow to pass private key and passphrase in connection string. Please url encode the private key and passphrase.
If you pass a passphrase in the connection string, please url encode it.
```toml
# keep it at the top of your toml file! before any section starts
destination.snowflake.credentials="snowflake://loader:<password>@kgiotue-wn98412/dlt_data?private_key=<url encoded pem>&private_key_passphrase=<url encoded passphrase>"
destination.snowflake.credentials="snowflake://loader:<password>@kgiotue-wn98412/dlt_data?private_key=<base64 encoded pem>&private_key_passphrase=<url encoded passphrase>"
```

## Write disposition
Expand Down

0 comments on commit d7c0aaf

Please sign in to comment.