Proper Usage of Synapse Notebook References

Clover J 200 Reputation points
2024-05-30T12:13:23.6933333+00:00

I'm attempting to utilize the Azure Synapse notebook reference outlined in the documentation provided here:

https://learn.microsoft.com/en-us/azure/synapse-analytics/spark/apache-spark-development-using-notebooks?tabs=preview#notebook-reference

In my setup, both notebook_1 and notebook_2 reside within the root folder of Synapse notebooks and have been published. Notebook_1 is published in the workspace, and I'm trying to call it in Notebook_2 using %run 'notebook_1'.

However, I encountered an error:

MagicUsageError: Cannot read notebook 'notebook_1'. The possible reason is that the notebook doesn't exist.

I've attempted other variations like 'notebook_1.ipynb', './notebook_1.ipynb', but without success.

Could anyone offer advice on the correct approach for achieving this? Many thanks.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
{count} votes

Answer accepted by question author
  1. Smaran Thoomu 32,525 Reputation points Microsoft External Staff Moderator
    2024-05-30T12:37:53.94+00:00

    Hi @Clover J

    Thank you for reaching out with your question about using Synapse Notebook references. Based on the error message you received, it seems like the notebook you are trying to reference may not be in the correct location or may not exist.

    Can you please try running the %run command without the single quotes around the notebook name, like this: %run notebook_1
    122868-image.png

    This should work as long as the notebook file is in the root folder of Synapse notebooks and has been published.

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.