-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SNOW-1808401: Issue while reading private key from azure functions configs #1060
Comments
hi, thanks for raising this issue. So Snowflake.Data 2.2.0 is very old and several bugfixes were introduced since it was released. Do you think it would be possible to try with the latest version? Also can you please give me the case number you had with Snowflake Support where the advice was to raise the issue here ? |
i have updated Snowflake.Data to 4.2.0 but still the same issue. littlebit different error msg though below is the error message now. Error: Could not read private key with value passed in connection string. \n Error : incorrect private key value or private key format: use "\n" for newlines and double the equals sign. SqlState: , VendorCode: 270052, QueryId: : System.FormatException: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. case number with snowflake support is below please let me know if you find any solution. we are almost stuck with deployment into azure |
Thank you - from the support case I understand that
thus the issue might be specific to how Azure is formatting the key and I also see
What you can also try:
|
closing this issue for now but please let us know if you need any further help here. |
I always get below exception when my azure serverless application reads private key and tries to connect to snowflake.
Error: Could not read private key with value passed in connection string. \n Error : incorrect private key value or private key format: use "\n" for newlines and double the equals sign. SqlState: , VendorCode: 270052, QueryId: : System.NullReferenceException: Object reference not set to an instance of an object.
I have tried adding "\n" and double equal signs in my privatekey but still not working. Strange thing is same connection string with private key works fine, if i run serverless application locally in visual studio on my windows laptop. below is sample snowflake connection string which i am coufiguring in cloud service.
account=accountName;ROLE=roleName;user=userName;AUTHENTICATOR=snowflake_jwt;PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\nASDASDASDjkhkjhASDASDkjhkjj\najhgsdjhasgdhjasdASDASDASDajshdjhsaasdas\njkashdkhjsk\n83798324jksdfhkjsdfv7jXxSXsY4xW\n-----END PRIVATE KEY-----\n";schema=schemaName;db=dbName;
Can you please suggest any solution to this. i did connect with snowflake team but they mention as request is not reaching to snowflake so it means the issue is with .net driver which is Snowflake.Data V2.2.0
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of .NET driver are you using?
Snoeflake.Data V 2.2.0
What operating system and processor architecture are you using?
linux
What version of .NET framework are you using?
.net 8.0
What did you do?
What did you expect to see?
it should accept the snowflake connection string with private key and then connect to snowflake
Can you set logging to DEBUG and collect the logs?
Error: Could not read private key with value passed in connection string. \n Error : incorrect private key value or private key format: use "\n" for newlines and double the equals sign. SqlState: , VendorCode: 270052, QueryId: : System.NullReferenceException: Object reference not set to an instance of an object.
https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors
There is an example in READMD.md file showing you how to enable logging.
Before sharing any information, please be sure to review the log and remove any sensitive
information.
The text was updated successfully, but these errors were encountered: