I need to connect my .Net Core 6.0 web app from Azure to snowflake. I have RSA key stored locally and in the connection string it is referenced:
SnowflakeDbCon": "account=**************;authenticator=snowflake_jwt;user=xxxxxxxx;private_key_file=c:Keysrsa_key.p8;private_key_pwd=yyyyyyyyy;db=dbbbbbbb;schema=MY_SCHEMA;"
Code:
builder.Services.AddScoped(_=>
new SnowflakeDbConnection { ConnectionString = builder.Configuration.GetConnectionString("SnowflakeDbCon") });
This works as expected. But I need to deploy to Azure and I am not sure how the key file path in Azure in the connection string will work.
I tried removing the key file path reference and adding the key file to the project
private_key_file=rsa_key.p8
this works locally, but fails in Azure with the error
Could not find file ‘C:homesitewwwrootrsa_key.p8’
2
Answers
These steps helped me create the key file and upload to the wwwroot folder! TY
As a side note, I has to change Deployment method to Zip Deploy.
You change path from
C:homesitewwwroot
toD:homesitewwwroot
and add rsa_key.p8 in this pathD:homesitewwwroot
by using following steps.Advance Tools
and select its.