Forum Discussion
Select the fabric kernel to debug spark job definition in VSCode
- 1 year ago
Currently, Spark Job Definitions cannot be debugged using the Fabric kernel in VSCode. The Fabric kernel is mainly designed for running notebooks, whereas Spark Job Definitions require execution on the remote Spark Runtime. If you try to debug a Spark Job Definition using the Fabric kernel, it won’t function as expected since it lacks the necessary Spark execution environment.
To properly develop and debug Spark jobs, you need to select the remote Spark Runtime, which provides the required Spark components and dependencies. This ensures that your job runs in an environment similar to the one it will be deployed in, allowing for accurate testing and debugging.
If you were expecting this functionality within the Fabric kernel itself, it would be worth checking Microsoft’s official roadmap or documentation for any future support. Having the ability to debug Spark Job Definitions directly in the Fabric kernel would be a valuable enhancement, as it would streamline development and testing workflows without requiring an external runtime.
Are there any specific issues you’re facing while debugging your Spark Job Definition? Let me know how I can assist further!
Hi Broeks,
Thank you for reaching out with your query. Kindly follow the steps below to address the issue:
-
Ensure that the latest Synapse VS Code extension is installed. Verify that OpenJDK 8 is correctly installed and added to the system PATH. Additionally, select the appropriate Fabric runtime (ex:fabric-synapse-runtime-1.2) in VS Code.
-
Currently, VS Code does not support the Fabric kernel for debugging Spark job definitions. Spark job definitions run locally and do not connect to the Fabric Spark cluster in the cloud. Tools such as mssparkutils and notebookutils are specifically designed for use in Notebooks and Fabric-managed environments, and they are not compatible with local Spark job definitions.
-
As an alternative, you may develop and debug the code in a Fabric-enabled notebook in VS Code, where mssparkutils and notebookutils are accessible. Once the code is finalized, test the Spark job definition in the Fabric portal to validate its behavior in the cloud.
For further reference, please refer to the following documentation:
- VS Code Extension Overview - Microsoft Fabric
- Create and Manage Apache Spark Job Definitions in VS Code - Microsoft Fabric
If you find this response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.
Thank you.
Thanks! This explains why I'm not able to run spark job definitions on the fabric kernel. My suggestion would be to change the following line:"When you run the notebook or Spark Job Definition, you can choose the local conda environment or remote Spark Runtime. " on page: https://learn.microsoft.com/en-us/fabric/data-engineering/fabric-runtime-in-vscode#considerations-for-choosing-local-conda-environment-or-remote-spark-compute as it's suggests it's possible to run the spark job definition on the fabric kernel.
Another question would be: will this be a feature in the (near) future? As it would open the door for us the develop spark job definitions in a proper way.
- Apikpo091 year agoNew Member
Thanks for your feedback! You’re absolutely right—this line could be misleading, as it implies that Spark Job Definitions can run on the Fabric kernel, which is not currently supported. This could cause confusion for users who expect seamless execution of Spark jobs in this environment. Updating this wording to clarify the distinction between running notebooks and Spark Job Definitions would definitely improve the documentation and help users understand the limitations of the current setup.
Additionally, I’d like to inquire whether there are any plans to support running Spark Job Definitions directly on the Fabric kernel in the future. Having this capability would be a major enhancement, as it would allow developers to create, test, and debug Spark jobs more efficiently within the Fabric ecosystem without relying on external runtimes. The ability to execute Spark Job Definitions seamlessly within Fabric would streamline development workflows and improve productivity, especially for teams that rely on structured Spark workloads.
If this feature is on the roadmap, it would be great to get some insights into its expected timeline or any upcoming improvements in this area. Looking forward to your thoughts on this!