ADF Snowflake Connector - Key pair authentication - Failed to parse PEM block containing the private key.

Md, Muzaffar 20 Reputation points
2024-04-22T20:11:10.47+00:00

I have created RSA key pair for my snowflake service account.

I tested authenticating snowflake with this RSA keys in python. Data from snowflake loaded successfully.

Now I'm trying to use this RSA private key for authentication in ADF.

I have followed step by step procedure from this documentation.

https://learn.microsoft.com/en-us/azure/data-factory/connector-snowflake?tabs=data-factory#key-pair-authentication

But my Privatekey is not working in the snowflake connector.

Added newline characters (\n) to each line in the privatekey file as per above documentationDC1U4[1]
This is my private keyprivate Key

While addign this private key in linked service getting this error - Failed to parse PEM block containing the private key.

IDQ99[1]

Tried in all the ways like - adding newline char (\n), removing newline char, removing header (-----BEGIN PRIVATE KEY-----) & footer (-----END PRIVATE KEY-----) of private key.. nothing worked.

I have checked for special characters in my key. I have these three special characters + / = in my key.

Can anyone please help me on this.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,599 questions
{count} votes

Accepted answer
  1. BhargavaGunnam-MSFT 26,306 Reputation points Microsoft Employee
    2024-04-23T16:48:13.04+00:00

    After further checking with PG, they confirmed, this is a bug from ADF UI that it's unable to handle the multi-line key properly. The product team is working on a fix for this issue.

    As a resolution, Please use Azure CLI to set the private key value in Azure key vault and it works.

    az keyvault secret set --vault-name <vaultName> --name <secretName> --file <privateKeyFilePath>

    Also please change the account name along with organization name.

    This resolves the issue.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful