Power BI Refresh Error:
251008
What does this error mean?
The private key provided for key-pair authentication is malformed, incorrectly formatted, or cannot be loaded by the Python connector. Snowflake cannot validate the JWT assertion needed to authenticate.
Common causes
- 1The private key PEM file has incorrect line endings or encoding (e.g., Windows CRLF)
- 2The private key is provided as a string but is missing newlines required for PEM format
- 3The private key is encrypted (passphrase-protected) but no passphrase was provided
- 4The wrong key type was used (RSA is required; EC keys are not supported)
- 5The private_key parameter was passed as a file path string instead of the key bytes/object
How to fix it
- 1Load the key correctly: use cryptography.hazmat.primitives.serialization.load_pem_private_key(key_bytes, password=None).
- 2If the key is passphrase-protected, pass the passphrase: load_pem_private_key(key_bytes, password=b'mypassphrase').
- 3Verify the key file format: openssl rsa -in private_key.p8 -check should return 'RSA key ok'.
- 4Ensure the key is RSA 2048-bit or higher — Snowflake does not support EC keys for JWT auth.
- 5When reading from env var, decode base64 if the key was stored base64-encoded: base64.b64decode(os.environ['PRIVATE_KEY']).
Frequently asked questions
Official documentation: https://github.com/snowflakedb/snowflake-connector-python/blob/main/src/snowflake/connector/errorcode.py