Forum Discussion
Question Regarding Terminating Long-Running User Sessions in Microsoft Fabric
- 1 year ago
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
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?
- lbendlin1 year ago
Super User
Notebooks run inside spark sessions. Killing the session will terminate the notebook.
- felipecpereira1 year agoRegular Visitor
Sure! And what about other processes? I would like to terminate a process when it reaches a specific execution time, for example
- v-lgarikapat1 year ago
Community Support
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