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

Join the OneLake & Platform Admin teams for an ask US anything on July 16th. Join now.

Reply
sertajmujawar
New Member

Unable to write the data into KQL database from Notebook

Hi Team,

 

I am unable to write the data into my KQL database from python notebook. I am using Microsoft Fabric free trial account. I was able to read the data from KQL table but I am unable to write the data. I have pasted the screenshot of my code.  

 

# The Kusto cluster uri to write the data. The query Uri is of the form https://<>.kusto.data.microsoft.com
# The database to write the data
database = "NGED"
# The table to write the data
table    = "temp"
# The access credentials for the write
accessToken = mssparkutils.credentials.getToken('kusto')

# Generate a range of 5 rows with Id's 5 to 9
data = spark.range(5,10)

# Write data to a Kusto table
data.write.\
format("com.microsoft.kusto.spark.synapse.datasource").\
option("kustoCluster",kustoUri).\
option("kustoDatabase",database).\
option("kustoTable", table).\
option("accessToken", accessToken ).\
option("tableCreateOptions", "CreateIfNotExist").mode("Append").save()
1 ACCEPTED SOLUTION
v-veshwara-msft
Community Support
Community Support

Hi @sertajmujawar ,

Thanks for posting in the Microsoft Fabric Community.

Please use the Query URI instead of the Ingestion URI and try again to write data to the KQL database.
You can find it in the Overview section under Database Details.

vveshwaramsft_0-1741280598611.png

For reference, here is a similar discussion where this issue was resolved Solved: Writing to KQL db from notebook - Error - Microsoft Fabric Community

Hope this helps. Please reach out for further assistance.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.

Best Regards,
Vinay.

 

View solution in original post

6 REPLIES 6
sertajmujawar
New Member

Yes, it is working now. Thank you.

v-veshwara-msft
Community Support
Community Support

Hi @sertajmujawar ,

Could you please mark the helpful reply as "Accept as Solution" to assist others facing similar issues? This helps the community quickly find the right answers.

We appreciate your cooperation and look forward to supporting you with any future queries in the Fabric Community Forum.

Best regards,
Vinay.

sertajmujawar
New Member

Thank you, I was able to write the data into KQL database, after correcting the URL

Glad to hear that it worked after correcting the URL. Could you also consider marking the reply as "Accept as Solution" to assist others facing similar issue.

Please continue using Fabric Community Forum for further queries.

Best Regards,
Vinay.

v-veshwara-msft
Community Support
Community Support

Hi @sertajmujawar ,

Just following up on your issue to see if you’ve found a solution. If so, please mark the helpful reply as the Accepted Solution to assist others with similar issues. If you still need help, feel free to reach out for further assistance.

Best regards,
Vinay.

v-veshwara-msft
Community Support
Community Support

Hi @sertajmujawar ,

Thanks for posting in the Microsoft Fabric Community.

Please use the Query URI instead of the Ingestion URI and try again to write data to the KQL database.
You can find it in the Overview section under Database Details.

vveshwaramsft_0-1741280598611.png

For reference, here is a similar discussion where this issue was resolved Solved: Writing to KQL db from notebook - Error - Microsoft Fabric Community

Hope this helps. Please reach out for further assistance.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and a kudos would be appreciated.

Best Regards,
Vinay.

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors