Forum Discussion

jaryszek's avatar
jaryszek
Super User
1 month ago

Can external Codex/Claude run code through the live Fabric notebook connection in VS Code?

Hi everyone,

I’m using Microsoft Fabric notebooks in VS Code with a live interactive Fabric connection. In that mode, notebook code should run against the Fabric Spark runtime, with access to pyspark, notebookutils, lakehouse context, etc.

I also tried using Fabric Spark Job Definitions for this workflow, but debugging them as a Spark/Fabric kernel is not working for me. When I use VS Code actions like Run Cell, Debug Cell, Run Python File, or the interactive window, the code runs locally instead, and I get errors like:

ModuleNotFoundError: No module named 'pyspark'

 

So my question is:

 

Is there any supported way for an external Codex agent to execute code through the same live interactive Fabric notebook connection that VS Code uses?

 

Or is Codex limited to editing local files, while execution/debugging must still be triggered manually from the Fabric notebook or Spark Job Definition UI?

 

Thanks!

 

p.s. I am not interested in official Microsoft docs answers because they are not working for me-debugging notebooks with UI is not a real software engineer solution, i need an editor like Visual Studio.

7 Replies

  • v-achippa's avatar
    v-achippa
    Community Support

    Hi jaryszek,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    Currently there is no supported way for external AI agents such as codex or claude to execute code through the live fabric notebook connection in vs code. They can assist with editing or generating code, but execution and debugging still need to be initiated through the fabric notebook or spark session. This is a current product limitation rather than an issue with your environment.

     

    Thanks and regards,

    Anjan Kumar Chippa

    • jaryszek's avatar
      jaryszek
      Super User

      Thank you I am aware of the product limitation. 

      The question is more how to work around it and if somebode manages to do this.

      • v-achippa's avatar
        v-achippa
        Community Support

        Hi jaryszek,

         

        Thank you for the clarification. At present, there is no supported workaround that allows external AI agents to execute code through the same live fabric notebook connection in vs code.

        If this capability would improve your workflow, I recommend submitting it to the Microsoft Fabric Ideas forum so it can be reviewed by the product team for future consideration.

        Fabric Ideas - Microsoft Fabric Community

         

        Thanks and regards,

        Anjan Kumar Chippa