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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

Error message when trying to run mssparkutils.lakehouse.get("Lakehouse name")

We are using a CICD pipeline to deploy our notebooks in workspaces.

In the DEV-TEST-ACC-PRD workspaces the same lakehouse can be found with the same name 'FA_BRONZE'. We now need to write the notebooks dynamically so that in every workspace, that correct lakehouse is used when writing tables away. For that we need to get the lakehouse ID so that we can use it with a variable in the abfss:// path. 

This post: (screenshot) references a function mssparkutils.lakehouse.get() to get the ID of a lakehouse when you provide the name of that lakehouse. But for us unfortunatly this gives an error (see below).

Does any of you have any experience with using this function or another solution to our problem?



Py4JJavaError: An error occurred while calling z:mssparkutils.lakehouse.get. : org.json4s.MappingException: Do not know how to convert JArray(List(JString(Lakehouse), JString(Lakehouse), JString(Lakehouse), JString(Lakehouse), JString(Lakehouse), JString(Lakehouse), JString(Lakehouse), JString(Lakehouse))) into class java.lang.String at org.json4s.reflect.package$.fail(package.scala:53) at org.json4s.Extraction$.convert(Extraction.scala:888) at org.json4s.Extraction$.$anonfun$extract$10(Extraction.scala:456) at org.json4s.Extraction$.$anonfun$customOrElse$1(Extraction.scala:780) at scala.PartialFunction.applyOrElse(PartialFunction.scala:127) at scala.PartialFunction.applyOrElse$(PartialFunction.scala:126) at scala.PartialFunction$$anon$1.applyOrElse(PartialFunction.scala:257) at org.json4s.Extraction$.customOrElse(Extraction.scala:780) at org.json4s.Extraction$.extract(Extraction.scala:454) at org.json4s.Extraction$.extract(Extraction.scala:56) at org.json4s.ExtractableJsonAstNode.extract(ExtractableJsonAstNode.scala:22) at$.parseItem(Artifact.scala:43) at$.$anonfun$parseJsons$1(Artifact.scala:56) at scala.collection.immutable.List.flatMap(List.scala:366) at$.parseJsons(Artifact.scala:55) at at at mssparkutils.lakehouse$.get(lakehouse.scala:16) at mssparkutils.lakehouse.get(lakehouse.scala) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke( at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke( at java.base/java.lang.reflect.Method.invoke( at py4j.reflection.MethodInvoker.invoke( at py4j.reflection.ReflectionEngine.invoke( at py4j.Gateway.invoke( at py4j.commands.AbstractCommand.invokeMethod( at py4j.commands.CallCommand.execute( at at java.base/

Frequent Visitor

Hi, the workspace was already in runtime 1.2.

Hi @MichBDO 
Apologies for the delay in response. Are you still facing this issue?
If yes we will revert back and try to help you.

Community Support
Community Support

Hi @MichBDO 
Thanks for using Fabric Community.
The mssparkutils.lakehouse feature is not documented yet officially. Hence we do not know when the feature will be deployed.
As a workaround you can leverage the Fabric REST Item APIs to get the lakehouse ID. Please refer to this link for more information: Link1

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

Hi @MichBDO 
There is a known issue in runtime1.1. So could you please change to runtime1.2 (spark3.4) version? 
Go to workspace settings and change the spark environment.


Now try to run the code in the notebook.



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

Helpful resources


Fabric Monthly Update - June 2024

Check out the June 2024 Fabric update to learn about new features.


Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.