Just came across a task and had to do some digging to find the answer:

How to export Azure Synapse artifacts, more specifically pipelines, conserving their folder hierarchy, when Git integration is not available as an option, and not doing it through ARM templates.

Below is the solution found:

  1. On Azure Cloud Shell, with the following bash script:

1- on Azure cloud shell, with the following bash scritpt:

#!/bin/bash

WORKSPACE_NAME= "--YOUR-WORKSPACE-NAME--" # Change workspace name accordingly
OUTPUT_DIR="synapse_pipelines_export"

mkdir -p "$OUTPUT_DIR"

# get pipelines and respective folder location

pipeline_names=$(az synapse pipeline list \
    --workspace-name "$WORKSPACE_NAME" \
    --query "[].name" -o tsv)

pipeline_folders=$(az synapse pipeline list \
    --workspace-name "$WORKSPACE_NAME" \
    --query "[].folder.name" -o tsv)

# Read the output into arrays
readarray -t pipeline_names <<< "$pipeline_names"
readarray -t pipeline_folders <<< "$pipeline_folders"

for ((i=0; i<${#pipeline_names[@]}; i++)); do
    mkdir -p "$OUTPUT_DIR/${pipeline_folders[i]}"
    echo "Exporting Pipeline: ${pipeline_names[i]} into folder $OUTPUT_DIR/${pipeline_folders[i]}"
        az synapse pipeline show \
        --name "${pipeline_names[i]}" \
        --workspace-name "$WORKSPACE_NAME" \
        > "$OUTPUT_DIR/${pipeline_folders[i]}/${pipeline_names[i]}.json"
done

2- download zip file to local.

0

Your Reply

By clicking “Post Your Reply”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.