To configure key-pair authentication for Snowflake data sources, the Snowflake private key must be provided in full. When using the Data Sources API to create or update a Snowflake data source with key-pair authentication, the request payload is provided in JSON format. Therefore, the multiline format of the Snowflake private key must be modified for the JSON payload. Note that the format of the private key should not be changed when configuring the data source in the Web UI.

Note: The examples below use ellipses (...) to indicate characters omitted from the Snowflake private key. However, the entire private key must be specified with the PrivateKeyContent parameter in the JSON payload as a single continuous string.

Consider the following private key.

-----BEGIN ENCRYPTED PRIVATE KEY-----
NIJGElCChlrqjljH8x1CCS1xNzBcChlrqjljH8x1CCSxxEhRJBq2k+GjS7gBCjjB
OJHFKkDDejmrkmkI7y2DDT2yOzCdDijmrkmkI7y2DDTyyFiSKCr3l+HkT8hCDkkC
PKIGLlEEfknslnlJ6z3EET3zPaDeEfklnslJ6z3EETzzGjTLDr4m+IlU9iDEllD
...
-----END ENCRYPTED PRIVATE KEY-----

For the request payload, the line breaks must be replaced with carriage return and newline character escape sequences (\r\n). Here is a sample request payload with the modification.

{
  "name": "Snowflake_Data",
  "dataStore": "76",
  "connectionType": "Cloud",
  "description": "Snowflake OData data source",
  "options": {
    "User": "UserOne",
    "AccountName": "datadirect_software.us-east-1",
    "PrivateKeyPassphrase": "MySnowflakePassword",
    "AuthenticationMethod": "KeyPair",
    "PrivateKeyContent": "-----BEGIN ENCRYPTED PRIVATE KEY-----\r\nNIJGElCChlr
qjljH8x1CCS1xNzBcChlrqjljH8x1CCSxxEhRJBq2k+GjS7gBCjjB\r\nOJHFKkDDejmrkmkI7y2DDT2
yOzCdDijmrkmkI7y2DDTyyFiSKCr3l+HkT8hCDkkC\r\nPKIGLlEEfknslnlJ6z3EET3zPaDeEfkln
slJ6z3EETz zGjTLDr4m+IlU9iDEllD\r\n...\r\n-----END ENCRYPTED PRIVATE KEY-----",
    "DatabaseName": "MySnowflakeDB",
    "Schema": "PUBLIC",
    "Warehouse": "MySnowflakeWarehouse",
    "ODataVersion": "4"
    }
}