Databricks to snowflake data load

SuMiT1
New Contributor III

Hi Team,

 

I’m trying to load data from Databricks into Snowflake using the Snowflake Spark connector. I’m using a generic username and password, but I’m unable to log in using these credentials directly. In the Snowflake UI, I can only log in through “Sign in with Azure AD.”

 

Below is the code snippet I’m using:

 

sfOptions = {

    "sfURL": "XD1.privatelink.snowflakecomputing.com",

    "sfDatabase": "Z_AICS",

    "sfSchema": "ASK_SMG",

    "sfWarehouse": "WAGT_ETL",

    "sfUser": "sys_aski@xyz.com",

    "sfPassword": "Qtr3tdint$",

    "sfRole": "AZURE_DATA_PLATFORMS"

}

 

selected_df.write \

    .format("snowflake") \

    .options(**sfOptions) \

    .option("dbtable", "DIM_TOPIC") \

    .mode("overwrite") \

    .save()

 

However, I’m getting the following error:

 

> Incorrect username or password was specified.

 

 

 

Could anyone please suggest how to authenticate and connect Snowflake from Databricks when Azure AD SSO is required for login?