Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
bergen288
Helper IV
Helper IV

"Failed to parse PEM block containing the private key" in PowerBI snowflake connector with key auth

My personal account to login to Snowflake website requires MFA so it won't work as user/password in PowerBI snowflake connector.  My PowerBI Version is 2.153.910.0 64-bit (April 2026) and it has option for key authentication.  My snowflake service account with encrypted p8 key works with Python and SQLTools in VS Code while its decrypted counterpart p8 key works in odbc.ini (isql).  However, both encrypted/decrypted p8 keys in PowerBI snowflake connector give me "Failed to parse PEM block containing the private key".  How to make it work?

 

[DPS_XXXX_XXXX] in odbc.ini:
Driver=/usr/lib64/snowflake/odbc/lib/libSnowflake.so
Server=cga19429.us-west-2.privatelink.snowflakecomputing.com
Database=DPS_XXXX_XXXX_MRT
Warehouse=DPS_XXXX_XXXX_ETL_WH
Role=DPS_XXXX_XXXX_ETL
UID=DPS_PYTHON_PROD_XXX_XXXX_SVCACCT
Authenticator=SNOWFLAKE_JWT
PRIV_KEY_FILE=/prod1/python_projects/Certs/DPS_PYTHON_PROD_XXX_XXXX_SVCACCT_rsa_key_decrypted.p8

 

Settings for PowerBI snowflake connector:
Server: cga19429.us-west-2.privatelink.snowflakecomputing.com
Warehouse: DPS_XXXX_XXXX_ETL_WH
Database: DPS_XXXX_XXXX_MRT
Auth: Key‑pair authentication
Username: DPS_PYTHON_PROD_XXX_XXXX_SVCACCT
Private key: C:\Users\f79tvh6\Documents\certs\DPS_PYTHON_PROD_XXX_XXXX_SVCACCT_rsa_key_decrypted.p8

 

Key filersa_key.p8rsa_key_decrypted.p8
PassphraseYesNo
Starting Line-----BEGIN ENCRYPTED PRIVATE KEY----------BEGIN PRIVATE KEY-----
UsedPython; SQLTools in VS CodeODBC & ISQL
1 ACCEPTED SOLUTION
Shai_Karmani
Solution Sage
Solution Sage

From what you posted, the Private Key field in the Power BI Snowflake connector has the file path (C:\Users\...\rsa_key_decrypted.p8) instead of the actual key text. That field expects the PEM contents, not a path, so it tries to parse the path string as a PEM block and fails with exactly the error you are seeing.

 

Open the .p8 file in a plain text editor, copy the entire contents including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines and the line breaks in between, and paste that into the Private Key field. If you go with the encrypted key, also fill in the passphrase field. Make sure no extra spaces or blank lines are added at the start or end when pasting.

 

If this helped, please mark it as the accepted solution and give it a thumbs up.

 

Best,

Shai Karmani

Let's connect in LinkedIn

View solution in original post

4 REPLIES 4
bergen288
Helper IV
Helper IV

The authentication failed at first with pasted key contents because of missing Role.  Once Role is added in Advanced options, authentication is successful.

 

Thanks.

v-sgandrathi
Community Support
Community Support

Hi @bergen288,

 

Thank you @stoic-harsh  and @Shai_Karmani  for your responses to the query.

Following up to check whether you got a chance to review the suggestions given. If the issue still persists please let us know. Glad to help. 

 

Thank you.

stoic-harsh
Solution Supplier
Solution Supplier

Hey @bergen288,

The paste-vs-path theory is worth trying, but Power BI 2.153.910.0 uses a file picker. It reads the file contents internally, so that might not be the root cause. If it doesn't work, try to:

1. Re-export the key cleanly via OpenSSL (will prompt for your key passphrase):

openssl pkcs8 -in rsa_key.p8 -topk8 -nocrypt -out rsa_key_powerbi.p8

2. Fix line endings. The .p8 was generated on Linux (LF) but Power BI's .NET PEM parser expects CRLF. Run on either platform (ensure windows has unix2dos installed):

unix2dos rsa_key_powerbi.p8

Then use rsa_key_powerbi.p8 in Power BI with the passphrase field left blank.

Best,

Harshit

Shai_Karmani
Solution Sage
Solution Sage

From what you posted, the Private Key field in the Power BI Snowflake connector has the file path (C:\Users\...\rsa_key_decrypted.p8) instead of the actual key text. That field expects the PEM contents, not a path, so it tries to parse the path string as a PEM block and fails with exactly the error you are seeing.

 

Open the .p8 file in a plain text editor, copy the entire contents including the -----BEGIN PRIVATE KEY----- and -----END PRIVATE KEY----- lines and the line breaks in between, and paste that into the Private Key field. If you go with the encrypted key, also fill in the passphrase field. Make sure no extra spaces or blank lines are added at the start or end when pasting.

 

If this helped, please mark it as the accepted solution and give it a thumbs up.

 

Best,

Shai Karmani

Let's connect in LinkedIn

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.