Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Solved! Go to Solution.
Thanks for your help, it was a mistake at my end. I was looking for a wrong file name.!
Thanks for your help, it was a mistake at my end. I was looking for a wrong file name.!
HI @sruthiramana,
The error message mention you can't directly access them without credentials, perhaps you can try to add authorization steps during load data from storage account.
For example:
from notebookutils import mssparkutils
# service principal
tenant_id = "<tenant_id>"
client_id = "<client_id>"
client_secret = mssparkutils.credentials.getSecret("https://YourKeyVault.vault.azure.net/","your-client-secret-secret-name")
# Azure storage detail
storage_account_name = "<account>"
container_name = "<container_name>"
file_path= "<file_path>"
# Spark configuration
spark.conf.set("fs.azure.account.auth.type", "OAuth")
spark.conf.set("fs.azure.account.oauth.provider.type", "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider")
spark.conf.set("fs.azure.account.oauth2.client.id", client_id)
spark.conf.set("fs.azure.account.oauth2.client.secret", client_secret)
spark.conf.set("fs.azure.account.oauth2.client.endpoint", f"https://login.microsoftonline.com/{tenant_id}/oauth2/token")
# Full file path
data_path = f"abfss://{container_name}@{storage_account_name}.dfs.core.windows.net/{file_path}"
# Read the data into a Spark DataFrame
df = spark.read.format("csv").option("header", "true").load(data_path)
# show the result
df.show()
Regards,
Xiaoxin Sheng
Hi @sruthiramana,
What is the abfss path you are using? You can replace the actual id-s with xxx, but I want to check if the right folders are selected. Furthermore, you don't need to start a Spark session within a Fabric notebook. Could you remove step 2? They may be a permission error there, since it is another session. A bit guessing here, but that session is not needed.