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

Md, Muzaffar 25 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 documentation
[image]

This is my private key

[image]

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

[image]

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.
11,624 questions
{count} votes

Accepted answer
  1. Bhargava-MSFT 31,261 Reputation points Microsoft Employee Moderator
    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.

    4 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.