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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Can't run Azure Fabric Notebook cells in VS Code

Hey,

I am trying to get Azure Fabric Notebook to work with VS Code using the Synapse Visual Studio Code Extension as described in: https://learn.microsoft.com/en-us/fabric/data-engineering/setup-vs-code-extension

I managed to install the prerequisites, my Java -version and conda --version both show that the path settings are set correctly. I installed the Synapse VS Code extension is VS Code. When launching VS Code I see the "fabric-synapse-runtime-1-1" and "fabric-synapse-runtime-1-2" are both created.

 

When I try to run a simple cell I get the message:

 

 

 

# Load Data from LH
df = spark.sql("SELECT * FROM TestLH.test")

 

 

 

 

 

---------------------------------------------------------------------------

AttributeError                            Traceback (most recent call last)

Cell In[1], line 2

      1 # Load Data from LH

----> 2 afas_df = spark.sql("SELECT * FROM TestLH.test")

AttributeError: 'NoneType' object has no attribute 'sql'

 

 

 

I have tried to install the package "pyspark" to see if it would resolve the issue, but it did not fix anything. When checking the logs of the notebook I see the following Error, besides a lot of Info messages:

 

 

 

10:43:57,960 root ERROR Failed to initialize Spark Lighter variables. Create session failed {'code': 'InternalError', 'subCode': 0, 'message': 'An internal error occurred.', 'timeStamp': '2024-08-02T08:43:57.1685726Z', 'httpStatusCode': 500, 'hresult': -2147467259, 'details': [{'code': 'RootActivityId', 'message': '9cf56fb4-67f6-425a-a43d-aeaad0768bca'}, {'code': 'Param1', 'message': 'Response status code does not indicate success: 430 ().'}]}

 

 

 

Can anyone of you perhaps give me some advice to fix my issue of not being able to run my cell? Thanks in advance!

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous 

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet.
In case if you have any resolution please do share that with the community as it can be helpful to others.
Otherwise, will respond back with the more details and we will try to help.

 

Best Regards,
Jing

Anonymous
Not applicable

I got the same error but finally got it work at my end. I have recorded all my steps in another thread, please refer to Re: spark not defined using VSCode Synapse Extensi... - Microsoft Fabric Community Hope it would be helpful to anyone who may encounter the same error. 

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Anonymous
Not applicable

Hi @Anonymous 

 

Sorry for the late response. Does this error still happen? Have you found a solution to it? 

 

Best Regards,
Jing

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.