Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
SriThiru
New Contributor III

Write data into synapse dedicated sql pool from fabric notebook

How to write data into synapse dedicated sql pool from fabric notebook. 


I want to save the spark dataframe from Fabric Notebook into Azure Synapse dedicated sql pool.

Is it doable, if yes, can anyone please share the code, along with any configuration settings if needed at the dedicated sql pool level.

1 REPLY 1
mabdollahi
Contributor

Hi @SriThiru ,

I see your question is remained as unanswered for a long time.

Yes, you can definitely write data from a Spark DataFrame in a Fabric Notebook to an Azure Synapse dedicated SQL pool.

Youโ€™ll just need to use the .write method with the jdbc format. Here's a simple example to get you started:

df.write \
  .format("jdbc") \
  .option("url", "jdbc:sqlserver://<your-server-name>.sql.azuresynapse.net:1433;database=<your-database-name>") \
  .option("dbtable", "<your-schema>.<your-table-name>") \
  .option("user", "<your-username>") \
  .option("password", "<your-password>") \
  .option("driver", "com.microsoft.sqlserver.jdbc.SQLServerDriver") \
  .mode("append") \
  .save()

A few quick tips:

  • Make sure your dedicated SQL pool allows Azure services to connect (you can set this in the firewall settings).

  • The table you're writing to should already exist in Synapse with the right schema.

  • If you're using managed identity instead of SQL auth, youโ€™ll need to handle authentication a bit differently (happy to help with that if needed).

Regards,

Mehrdad Abdollahi

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Free Fabric Certifications

Free Fabric Certifications

Get Fabric certified for free! Don't miss your chance.

January Fabric Update Carousel

Fabric Monthly Update - January 2026

Check out the January 2026 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (72)