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
felipecpereira
Regular Visitor

Question Regarding Terminating Long-Running User Sessions in Microsoft Fabric

We’ve noticed a long-running user session in Microsoft Fabric. Could you confirm whether there is a way to manually terminate user sessions after they have been running beyond a specified threshold?

 

I’ve reviewed documentation related to background activity in Lakehouse databases, but I need guidance on ending the session from a capacity-level control perspective (rather than within an individual Lakehouse/database context).

6 REPLIES 6
felipecpereira
Regular Visitor

Hi @v-lgarikapat and @lbendlin

 

In the Fabric report, we can check what has been executed, what is currently running, CU usage, etc. I would like to know if it's possible to terminate a user session once it meets a specific criterion, such as a session being open for more than 1 minute.

 

I hadn’t considered Spark, but is it also possible to terminate the session of a specific user who has been running a notebook for a long time?

Notebooks run inside spark sessions. Killing the session will terminate the notebook.

Sure! And what about other processes? I would like to terminate a process when it reaches a specific execution time, for example

 

felipecpereira_0-1753467942689.png

 

HI @felipecpereira ,

No native feature currently allows automatic session termination based on runtime duration. However, you can:

Monitor session duration manually through the Capacity Metrics or Spark Monitoring UI

Trigger actions via API or automation, but this requires you to:

Use the Microsoft Fabric REST APIs to pull session/user details

Cross-reference session starts times and durations

Use scripting (PowerShell, Python) to call the DELETE endpoint for those sessions

 

Same goes for other process typesrefreshes, queries, pipelines. Termination usually isn’t exposed unless it’s a Spark notebook.

 

Solved: SparkSession don't stop - Microsoft Fabric Community

Microsoft Fabric REST API references - Microsoft Fabric REST APIs | Microsoft Learn

Workspace administration settings in Microsoft Fabric - Microsoft Fabric | Microsoft Learn

 

Best Regards,

Lakshmi

v-lgarikapat
Community Support
Community Support

Hi @felipecpereira ,

Thanks for reaching out to the Microsoft fabric community forum.

@lbendlin 

Thanks for your prompt response

@felipecpereira 

Could you please provide more details in order to propose the appropriate solution? Please specify if you are referring to Spark sessions or something else

We look forward to hearing from you.

Best regards,
Lakshmi

 

lbendlin
Super User
Super User

Please specify if you mean Spark sessions or something else.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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