Skip to content
Tutorials>Azure Synapse Analytics>Part 3 — Synapse: Prepare and Create a Notebook

Part 3 — Synapse: Prepare and Create a Notebook

1. Create Storage account and assign role to your Synapse Workspace

  • Open the Azure Portal: Create a Storage Account (e.g. adls2synapseintf).
  • To assign the Storage Blob Data Contributor role to the system-assigned Managed Identity of your Synapse Workspace, proceed as follows: Navigate to the Azure Storage Account adls2synapseintf that your Synapse Workspace should access.
  • Open Access Control (IAM) in the left menu.
  • Assign roles: Click on + Add and then on Add role assignment.
  • Select role: Search for the role Storage Blob Data Contributor and select it.
  • Add member: In the "Members" section, select the Managed identity option.
    • Now search for the Synapse Workspace – for system-assigned Managed Identities, the name usually corresponds to the name of the workspace.
    • Select the corresponding entry.
  • Review and assign the assignment: Click on Review + assign to assign the role. After completing these steps, the system-assigned Managed Identity of your Synapse Workspace has permission to access Blob Storage.

2. Create the Blob Storage Container and Nested Directories

  • Navigate to your Azure Storage account adls2synapseintf in the Azure portal.

  • Under Data Storge, select Containers.

  • Click + Add Container and name the container tutorialcontainer → Choose an access level (e.g., "Private" for secure access) → Create.

  • Navigate into the newly created tutorialcontainer tutorialcontainer.

  • Click + Add Directory (from the top menu) and name the directory test → Save.

  • Enter the test directory, then use + Add Directory again to create the landing and bronze directory → Save.

  • Enter the landing directory, then use + Add Directory once more to create the directories (e.g., AIRPORTS, see the screenshot on the right) → Save.

3. Upload the CSV Files

  • Download Sample data( csv_landing_data_for_synapse_tutorial.zip ) and extract them.
  • Upload each extracted file to the corresponding folder you created earlier, e.g., upload aviation_data_airports.csv to the folder tutorialcontainer/test/landing/AIRPORTS or tutorialcontainer/test/landing/AIRPORTS/2025-10-15.

4. Create a Folder in Synapse Workspace

  • Open Synapse Workspace → Develop → Notebooks → Create a New subfolder named SYNAPSE_TUTORIAL.

  • In Synapse Workspace → Integrate → Pipelines → Create a Folder also named SYNAPSE_TUTORIAL.

5. Import a sample notebook

We've created a blank sample notebook that you can import into Synapse. Alternatively, you can create a new one yourself.

  • Download sample notebook ( landing_2_bronze.py ).
  • Import or copy-paste the Notebook into the SYNAPSE_TUTORIAL folder in Synapse, name the notebook landing_2_bronze.

Note:

You can also see a complete list of downloads in Prerequisites.

6. Check or adjust the uploaded notebook

  • Attach to your Spark pool:
    Make sure the notebook is attached to the Spark pool you created (e.g., ApacheSparkPool).

  • Select the language:
    Choose PySpark (Python) as the notebook language.

  • Verify and update configurations:
    In the code block labeled # Configurations, ensure that all parameters (such as STORAGE_ACCOUNT_NAME, LANDING_STORAGE_ACCOUNT_CONTAINER, LANDING_BASE_PATH) exactly match your own Blob Storage settings.

    ⚠️ Even an extra space or typo can cause the notebook to fail.

  • Enable parameter cell (if needed):
    Check whether the word Parameters appears at the bottom-right corner of the cell # Configurations.

    If it does not appear, click the three dots on the top-right of the cell.

    Then select Toggle parameter cell from the dropdown menu (as shown in the image).

  • Publish:
    You can click Publish to save and deploy your notebook.

  • Run the notebook:
    Finally, click Run all to test the notebook and make sure it executes successfully.