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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
marcoG
Resolver I
Resolver I

How get connection string in Spark for on premise/local db connection by gateway?

I tried:

mssparkutils.credentials.getFullConnectionString("<connectionName>")
 
but i have:
Py4JJavaError: An error occurred while calling z:mssparkutils.credentials.getFullConnectionString. : java.util.NoSuchElementException: spark.arcadia.session.token at org.apache.spark.SparkConf.$anonfun$get$1(SparkConf.scala:266) at scala.Option.getOrElse(Option.scala:189) at org.apache.spark.SparkConf.get(SparkConf.scala:266) at com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.$anonfun$getAccessTokenInternal$3(TokenLibrary.scala:271) at scala.util.Try$.apply(Try.scala:213) at com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.getAccessTokenInternal(TokenLibrary.scala:270) at com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.$anonfun$getAccessTokenInternal$4(TokenLibrary.scala:303) at scala.util.Try$.apply(Try.scala:213) at com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.getAccessTokenInternal(TokenLibrary.scala:291) at com.microsoft.azure.synapse.tokenlibrary.TokenLibrary.getAccessTokenAsync(TokenLibrary.scala:216) at com.microsoft.azure.synapse.tokenlibrary.TokenLibrary$.getFullConnectionString(TokenLibrary.scala:1216) at mssparkutils.credentials$.getFullConnectionString(credentials.scala:49) at mssparkutils.credentials.getFullConnectionString(credentials.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:244) at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:357) at py4j.Gateway.invoke(Gateway.java:282) at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:132) at py4j.commands.CallCommand.execute(CalCommand.java:79) at py4j.GatewayConnection.run(GatewayConnection.java:238) at java.lang.Thread.run(Thread.java:750)
3 REPLIES 3
marcoG
Resolver I
Resolver I

Hi @HimanshuS-msft ,

I was trying this solution as dataflow gen2 from on premise db through gateway is slow and not working.

Dataflow gen1 works but doesn't bring data to the lakehouse.

On-premise pipelines are not yet available

Do you have any other alternatives?

Thanks

HimanshuS-msft
Microsoft Employee
Microsoft Employee

HI @marcoG 

Thanks for using the Fabric community .

As I understand the ask here is to access the loacaldb from the Spark code . I don't thiink its possible as of now .

I think you should try out to use Dtaflow to copy the data to Lakehouse and then reference that in the notebook .
This document should help .
https://learn.microsoft.com/en-us/fabric/data-engineering/load-data-lakehouse#considerations-when-ch...

Thanks
HImanshu

There is some update?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Fabric Update Carousel

Fabric Monthly Update - September 2025

Check out the September 2025 Fabric update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.