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
gaya3krishnan86
Frequent Visitor

Spark sql execution for SPN fails with mwc token error

Is anyone else getting mwc token error on spark.sql execution with SPN accounts? SPN has contributor permission on the workspaces and the query refers to shortcut. Any ideas what can cause this? 

 

Thanks,

Gayatri

1 ACCEPTED SOLUTION

It looks like it fails for a named user too all of sudden but worked fine with workspace identity at the same time. Seems like some intermittent issue.

View solution in original post

3 REPLIES 3
v-veshwara-msft
Community Support
Community Support

Hi @gaya3krishnan86 ,

Thanks for posting in Microsoft Fabric Community.

The mwc token error when executing spark.sql with Service Principal accounts is usually tied to authentication and token handling. Even if the SPN has Contributor permissions on the workspace, it also needs the right data permissions on the underlying storage used by the shortcut. Please make sure the SPN is properly added as an identity in the Fabric workspace and can access the referenced data source.

 

From the behavior you described, since this involves a shortcut, testing a direct query on a Lakehouse or Warehouse table without the shortcut can help isolate if the issue is shortcut-specific.

 

Similar issues have been reported when running Spark SQL queries. Restarting the kernel can sometimes result in a “capacity limit exceeded” exception, indicating that session or capacity availability can contribute to the error: Solved: Re: Spark SQL error: MetaException(message: Unable... - Microsoft Fabric Community

 

There have also been cases where Spark SQL jobs in Fabric returned mwc token errors due to regional outages or bugs in the Spark engine. These incidents were intermittent and region-specific, and in some cases the issue resolved on retry.

For reference, you can check: Solved: Re: Spark SQL error: MetaException(message: Unable... - Microsoft Fabric Community

 

Hope this helps. Please reach out for further assistance.

Thank you.

 

It looks like it fails for a named user too all of sudden but worked fine with workspace identity at the same time. Seems like some intermittent issue.

Hi @gaya3krishnan86 ,
Thanks for confirming this. Since it also fails for a named user but works with the workspace identity, it appears to be an intermittent platform issue.

If you need further assistance, please reach out.

 

Thank you.

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.