Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I get the following error while trying to stop a spark session in a notebook using: mssparkutils.session.stop()
Does anyone know where the issue may come from ?
Thank you,
Amnay
Solved! Go to Solution.
Hi @akanane
Apologies for the issue you have been facing. Currently mssparkutils.session.stop() does not support in Fabric for now. The feature is releasing. We will have to wait until mssparkutils environment utils is ready.
Appreciate your patience.
Hope this helps. Please let us know if you have any further questions. Glad to help.
Hi @akanane
Thanks for using Microsoft Fabric Community.
Apologies for the issue that you are facing.
As I understand that you are getting an error while trying to stop a spark session in a notebook using: mssparkutils.session.stop().
To resolve this issue, you need to ensure that the JWT (JSON Web Token) is correctly formatted and contains the necessary information for authentication.
Here are a few steps you can take to troubleshoot and fix the issue:
I hope this helps. Please do let us know if you have any further questions.
Is there any documentation regarding the fix that you provided?
I was following the section: Introduction to Microsoft Spark utilities - Azure Synapse Analytics | Microsoft Learn. There is no mention of JWT tokens..
Hi @akanane
Apologies for the delay in response.
Currently mssparkutils supports only the below utilities.
fs:Utility for filesystem operations in Fabric
notebook:Utility for notebook operations (e.g, chaining Fabric notebooks together)
credentials:Utility for obtaining credentials (tokens and keys) for Fabric resources
lakehouse:Utility for lakehouse operations (e.g, create, delete, update, list lakehouse)
It doesn't support the session utility, this is the reason why you are facing an issue while running the code "mssparkutils.session.stop()".
You can use spark.stop() :
If you have spark
as a SparkSession object then call spark.stop()
to stop the session. This ensures that resources are properly released and the Spark application terminates gracefully.
I hope this helps. Please do let us know if you have any further questions.
Hi @akanane
Apologies for the issue you have been facing. Currently mssparkutils.session.stop() does not support in Fabric for now. The feature is releasing. We will have to wait until mssparkutils environment utils is ready.
Appreciate your patience.
Hope this helps. Please let us know if you have any further questions. Glad to help.
Hi @akanane
We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that same with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help .
Thanks
Hello,
Thank you for your answer, spark.stop() works 🙂 (but we don't see the session stopped in the UI)
With this command, session does not stop.
Hi @akanane
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.
I need to complete the run of pipeline within 15 mins but unfortunetly, most of the time is taken to start notebook sessions. To save time, exploring options to stop session. Please help with fabric option supported as of today.
User | Count |
---|---|
31 | |
10 | |
4 | |
3 | |
1 |
User | Count |
---|---|
47 | |
15 | |
14 | |
10 | |
9 |