I'm trying to use the below code to connect to my snowflake account using SQL alchemy. It's not working and my guess is that this is because we log in using Azure AD authentication. Any help appreciated.
from sqlalchemy import create_engine
engine = create_engine(
'snowflake://{user}:{password}@{account}/'.format(
user='xxx',
password='xxx',
account='xxx'
)
)
try:
connection = engine.connect()
results = connection.execute('select current_version()').fetchone()
print(results[0])
finally:
connection.close()
engine.dispose()
The error message:
DatabaseError: (snowflake.connector.errors.DatabaseError) 250001 (08001): Failed to connect to DB: QB67303.eu-west-1.snowflakecomputing.com:443. Incorrect username or password was specified.
(Background on this error at: http://sqlalche.me/e/13/4xp6)
authenticator='externalbrowser'
option to your connection parameters? That will then prompt you to log into your SSO provider when python makes a connection. – Mike Walton