AZ Synapse Notebooks export / import

Arie 61 Reputation points
2021-10-26T16:17:30.867+00:00

Were trying to import some sample notebooks to an Azure Synapse instance. The first command executed separately to export all notebooks:

az synapse notebook export --workspace-name wsname  --output-folder ./       
   
   
- task: AzureCLI@1   
      enabled: true   
      displayName: 'Load Notebooks'   
      name: 'deploy_sample_notebooks'   
      inputs:   
            azureSubscription: $(sub)   
            scriptLocation: 'inlineScript'   
            inlineScript: |   
              az synapse notebook import \   
              --workspace-name $(wsname) \   
              --name loadparquet \   
              --file '@./notebooks/notebook01.ipynb'   

Then trying to import using Azure CLI as part of a Devops pipeline, but no matter what I try it always results in error. The notebook file is located in notebooks directory in the git repo.

The error is:

ERROR: Failed to parse JSON: @./notebooks/notebook01.ipynb
Error detail: Expecting value: line 1 column 1 (char 0)
The JSON may have been parsed by the shell. See https://learn.microsoft.com/cli/azure/use-cli-effectively#quoting-issues

Any help would be much appreciated!

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.
5,316 questions
{count} votes

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,601 Reputation points
    2021-11-02T06:37:05.507+00:00

    Hello @Arie ,

    Could you please check whether the file path is right? The export cmdlet will not create subfolder under --output-folder, all the notebooks will be saved directly in the folder which specify by --output-folder. If you enter the right path and add @ at the beginning of the path, I suppose the import cmdlet can work well.

    Hope this will help. Please let us know if any further queries.

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

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

Your answer

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