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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Mnnleus
Frequent Visitor

Get name of Fabric workspace

Hello, 

I would like to retrieve the name of my workspace through a notebook, but this code doesn't work: spark.conf.get("trident.workspace.name")
Then this one works very well: 
spark.conf.get("trident.workspace.id")
Is it in preview or do you have to use another function?

Thank you in advance for your answers

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Mnnleus 
Thanks for using Fabric Community.
Currently there is no spark config that stores the workspace name. spark.config.get("trident.workspace.name") used to work before, but is not available now.

Hope this helps. Please let me know if you have any further questions.

View solution in original post

7 REPLIES 7
deborshi_nag
Community Champion
Community Champion

Hello @Mnnleus 

 

from notebookutils import mssparkutils

print(mssparkutils.env.getWorkspaceName())
I trust this will be helpful. If you found this guidance useful, you are welcome to acknowledge with a Kudos or by marking it as a Solution.
chetanhiwale
Resolver I
Resolver I

hi @Mnnleus , 

This works now. 
Code : 

spark.conf.get("trident.workspace.name")
aidan959
New Member

Hey @Mnnleus ,

 

Have found workaround -  the proposed "solution" (this is "not possible" 😒) is pretty unhelpful.

This code queries the fabric api for the workspace name taking the workspace ID from configuration. Should work if copy and pasted in.

 import sempy.fabric as fabric
 workspace_id = spark.conf.get("trident.workspace.id")
 workspace = fabric.FabricRestClient().get(f"/v1/workspaces/{workspace_id}").json()["displayName"]

 

12angrymentiger
Advocate III
Advocate III

This has broken some of my pipelines as I relied on this spark config. Hopefully this gets resolved soon or there is another fix in place.

Mnnleus
Frequent Visitor

Hi @Anonymous,

thank you for your answer

Anonymous
Not applicable

Hi @Mnnleus 
Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.

Anonymous
Not applicable

Hi  @Mnnleus 
Thanks for using Fabric Community.
Currently there is no spark config that stores the workspace name. spark.config.get("trident.workspace.name") used to work before, but is not available now.

Hope this helps. Please let me know if you have any further questions.

Helpful resources

Announcements
April Fabric Update Carousel

Fabric Monthly Update - April 2026

Check out the April 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.