Reputation: 11
I've recently been playing with the Snowpark API for developing python procedures locally in VSCode and deploying to Snowflake via snowflake.yml project configs. I'm using it to fetch data from an API and write to a table.
So far it's pretty promising, except for one hiccup. I can't see how to access Snowflake Secrets from code developed with the Snowpark API. My API call requires an API key to call, and I want to ensure it's secure.
The only documentation on accessing secrets from within python code is for defining a procedure using SQL and inline python which uses the _snowflake python modules which is exposed to python UDFs running within snowflake. See doc link here: https://docs.snowflake.com/en/developer-guide/external-network-access/secret-api-reference
I'm not defining UDFs like this however, I'm developing locally in pure python using the Snowpark API in VSCode Docs referenced here: https://docs.snowflake.com/developer-guide/snowpark/reference/python/latest/snowpark/index
I see no way to access secrets from these APIs, nor can I figure out how to import the _snowflake module from within my locally developed Snowpark procedures.
Has anyone done this, or have a suggestion?
Upvotes: 0
Views: 53