Here is my Snowflake connection in Python:
import snowflake.connector
ctx = snowflake.connector.connect(user='someuser@somedomain.com',
password='somepassword',
account='someaccount',
warehouse='somewarehouse',
database='somedb',
schema='someschema'
authenticator='someauth')
It works fine, but now I need to store my connection details in Azure Key Vault and is far as I understand it will be coming back as a string, which I will need to feed into snowflake.connector.connect()
So I tried to convert connection parameters into string:
connection_string = "user=someuser@somedomain.com;password=somepassword;account=someaccount;authenticator=someauth;warehouse=somewarehouse;database = somedb"
ctx = snowflake.connector.connect(connection_string)
but got back error message:
TypeError Traceback (most recent call last)
<ipython-input-19-ca89ef96ad7d> in <module>
----> 1 ctx = snowflake.connector.connect(connection_string)
TypeError: Connect() takes 0 positional arguments but 1 was given
I also tried extracting python dictionary from string with ast
library and feeding it into snowflake.connector.connect()
, but got back the same error.
So is there way to solve it? Am I missing something conceptually?