1

The magic commands work perfectly in Notebooks. However, While running the same notebook from the Synapse pipeline, it could not locate the notebook's path.

Appreciate your help

{
    "errorCode": "6002",
    "message": "MagicUsageError: Cannot read notebook Externals/Helper. The possible reason is that the notebook doesn't exist. More details please visit https://go.microsoft.com/fwlink/?linkid=2173018\n--> PartnerException: Exception of type 'Microsoft.Analytics.SynapseNotebookService.Infrastructure.Exceptions.ClientExceptions.PartnerException' was thrown.",
    "failureType": "UserError",
    "target": "sample",
    "details": []
}
Thom A
  • 88,727
  • 11
  • 45
  • 75
KK21
  • 11
  • 2

2 Answers2

0

if you are using GIT you need to publish the notebook first. After that the reference over the pipeline works.

Best regards Gio

Gio Mac
  • 3
  • 3
  • Thank you Gio for your response, It doesn't seem to be working even though all my notebooks and pipeline were committed to my working branch. Any Idea? – KK21 Oct 10 '22 at 16:21
  • Try to use following syntax for your command %run folder/notebook – Gio Mac Oct 13 '22 at 12:22
  • Im not sure what do you mean with working branch? I dont know your project structure but you have to publish your code on the publish branch for example "workspace_publish". Have a look here https://stackoverflow.com/questions/69904715/azure-synapse-workspace-where-the-scripts-are-published – Gio Mac Oct 13 '22 at 14:47
0

I tried to reproduce your scenario in my environment and got similar error. enter image description here The cause of error is the path you provided to the %run magic command %run command currently only supports to pass a absolute path

  • If your notebook is not in any folder, you can give path as %run /notebook name
  • If your notebook is present in any folder you can give path as %run /folder name/notebook name

And make sure you publish all the changes.

Here I am calling Notebook2 from Notebook1 enter image description here

Notebook ran successfully. enter image description here

Pratik Lad
  • 4,343
  • 2
  • 3
  • 11