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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sperotech
Frequent Visitor

Kusto connection fails in notebook action in pipeline

Hi,

I have a notebook action in a pipeline that keeps giving me the following error:

Notebook execution failed at Notebook service with http status code - '200', please check the Run logs on Notebook, additional details - 'Error name - Py4JJavaError, Error value - An error occurred while calling z:mssparkutils.credentials.getToken.
: java.io.IOException: 500 {"code":"TM_INTERNAL_ERROR","subCode":0,"message":"An internal error occurred.","timeStamp":"2024-10-16T12:33:50.8328415Z","httpStatusCode":500,"hresult":-2147467259,"details":[{"code":"RootActivityId","message":"a1e5ed04-3da7-43ec-a6ab-5c250757e571"}]}

 

The code I use to connect is:

# Kusto conncetion and database settings
from notebookutils import mssparkutils

# The Kusto cluster uri
kustoUri = "https://xxxxxxxx.kusto.fabric.microsoft.com"

# The access credentials for the write
accessToken = mssparkutils.credentials.getToken(kustoUri)

# The database to read the data from
database = "xxxxx"

 

 

My session is set to:  Runtime 1.2 (Spark 3.4, Delta 2.4)

 

The Notebook on itself (Run All command) runs just fine and is able to connect.

 

Does anyone know what is causing this?

 

Regards,

Marc

4 REPLIES 4
lbendlin
Super User
Super User

As it says in the message, 500 means something borked at the other end (whereas 200 usually means everything is fine).  Can you still reproduce the error?  If yes, and if you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .

Hi Ibendlin, I know what 500 means and that it is caused by a configuration issue in Fabric. Pipelines have access to Kusto because I have a few Kusto commands that work just fine but a notebook which tries to connect to Kusto fails (see this post which describes a similar issue).  The owner is the same for the pipeline and the notebook. Both are in the same workspace too.

 

Have you raised the ticket?

Just did in the PowerBi ideas. 👍

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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