Mount ADLS Gen2 Storage Using Linked Service in Azure Synapse Analytics
📘 Overview
Azure Synapse Analytics allows you to securely connect to Azure Data Lake Storage Gen2 (ADLS Gen2) using a Linked Service. Once configured, you can easily access files using the abfss://
path format within Spark notebooks or pipelines.
🎯 Why Use Linked Service?
- Centralized and secure credential management
- Reuse connection across notebooks and pipelines
- No need to hard-code credentials in code
- Simplified access using friendly names and workspace integration
🛠️ Step-by-Step: Configure and Use Linked Service
✅ Step 1: Create Linked Service
- Go to your Synapse workspace
- Navigate to Manage → Linked Services
- Click + New and choose Azure Data Lake Storage Gen2
- Enter a name (e.g.,
adls2-linked
) - Choose authentication method (Account Key, Service Principal, or Managed Identity)
- Test connection and click Create
✅ Step 2: Reference Storage in Notebooks
%%pyspark
df = spark.read.option("header", "true") \
.csv("abfss://<container>@<storageaccount>.dfs.core.windows.net/path/to/data.csv")
df.show()
✅ Step 3: Access from Synapse Pipelines
Once the linked service is created, you can:
- Use it in Copy Data and Data Flow activities
- Browse ADLS files using the Synapse Studio UI
📦 Example abfss Path Format
abfss://raw@techbrothersadlsgen2.dfs.core.windows.net/sales/data.csv
📌 Tips
- Use Managed Identity for enterprise security integration
- Ensure Synapse workspace has Storage Blob Data Contributor access to ADLS
- Use path autocompletion in notebooks for easy access
📺 Watch the Video Tutorial
📚 Credit: Content created with the help of ChatGPT.