I have a service account user set up in Snowflake. I have an ETL process set up in Pentaho that is using this service account to connect to Snowflake. I am connecting to Snowflake from Pentaho using a JDBC connection using key-pair authentication. When I run the ETL job manually within Pentaho it works perfectly without any issues. When I schedule a job within Windows Task Scheduler by firing off a batch file to run the job, the job fails saying "JDBC driver not able to connect to Snowflake. Error code: 390100, Message: Incorrect username or password was specified." It's a service account so no password is required. I am running the scheduled task as the user that I am logging in with to run the job manually so I'm not sure why the task is failing but when I run it manually it works. Any ideas on how I can get the scheduled task to run like I'm running it manually so that it works?
Here's my JDBC connection (removing sensitive info):
jdbc:snowflake://oxxxxxx.east-us-2.azure.snowflakecomputing/?private_key_file=C:/Users/mainuser/Keys/rsa_key.p8