Skip to content

Conversation

fmterrorf
Copy link

Adds an ability to read private key from an environment variable SNOWFLAKE_PRIVATE_KEY

@sfc-gh-twhite
Copy link
Collaborator

Thanks for the PR @fmterrorf! Ideally, we would like to leverage the environment variables for these credentials if possible.

Does providing those with either SNOWFLAKE_PRIVATE_KEY_PATH or SNOWFLAKE_PRIVATE_KEY_RAW work for you? These credential environment variables are documented at https://docs.snowflake.com/en/developer-guide/snowflake-cli/connecting/configure-connections#use-environment-variables-for-snowflake-credentials.

@fmterrorf
Copy link
Author

fmterrorf commented Aug 8, 2025

@sfc-gh-twhite I've tried SNOWFLAKE_PRIVATE_KEY_RAW but it does not seem to work. I'm avoiding SNOWFLAKE_PRIVATE_KEY_PATH since I don't want to write the private key file. The CLI has this line of code https://github.com/snowflakedb/snowflake-cli/blob/e62ddfcdbccbaa7d1b7a39d700c8d2e6945b9a8a/src/snowflake/cli/_app/snow_connector.py#L228-L230 that reads SNOWFLAKE_PRIVATE_KEY_RAW from the env variable. Schemachange don't have that currently

@sfc-gh-twhite
Copy link
Collaborator

@sfc-gh-twhite I've tried SNOWFLAKE_PRIVATE_KEY_RAW but it does not seem to work. I'm avoiding SNOWFLAKE_PRIVATE_KEY_PATH since I don't want to write the private key file. The CLI has this line of code https://github.com/snowflakedb/snowflake-cli/blob/e62ddfcdbccbaa7d1b7a39d700c8d2e6945b9a8a/src/snowflake/cli/_app/snow_connector.py#L228-L230 that reads SNOWFLAKE_PRIVATE_KEY_RAW from the env variable. Schemachange don't have that currently

Understood! Thank you for this info.

We have many open issues related to this topic, so I plan to address them this week. Noting here to check if the following will be resolved, as they seem similar:

@sfc-gh-tmathew sfc-gh-tmathew added the enhancement New feature or request label Aug 29, 2025
@andrew-davey
Copy link

@sfc-gh-twhite is there an ETA on when this enhancement will be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants