Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dungtran12
New Member

Help with Authentication failed and not presented in the request when reading a CSV file

Hello,

   I  tried the Micrososft Fabric tutorial on saving and reading the CSV file to and from the Lakehouse.

 

https://learn.microsoft.com/en-us/fabric/data-science/tutorial-data-science-ingest-data since I used the code from the notebook.

 

 

It worked fine on writting the csv file to the Lakehouse. However, it did not work when I tried to read the same csv file from the Lakehouse. The Notebook compiler complained on something like authentication failed and not presented on the request.

 

 

{"error":{"code":"Unauthorized","message":"Authentication Failed with Bearer token is not present in the request"}}

 

 

I was in my workspace and I had my CVS file presented in the Lakehouse. I did not know why it complaint about authentication on the request.  Could you please help to figure it out  what was missing since I used the exact same codes from the tutorial?

 

##df = (
##    spark.read.option("header", True)
##    .option("inferSchema", True)
##    .csv("/lakehouse/default/Files/churn/raw/churn.csv") 
##    .cache()   
##)


df = spark.read.format ("csv").option("header","true").load ("/lakehouse/default/Files/churn/raw/churn.csv")

 

 

I was in my workspace and I had my CVS file presented in the Lakehouse so it should not complaint about authentication.

 

LakehouseLakehouse

 

 

1 ACCEPTED SOLUTION

Hello,

   It worked! I I used the spark read api to load data from csv file from the lakehouse.

 

df = spark.read.format("csv").option("header","true").load("Files/churn/raw/churn.csv")
display(df)

Thanks,

Du

 

View solution in original post

2 REPLIES 2
dungtran12
New Member

Hello,

   I would like to update that it worked when I used the pandas read as  followed:

df = pd.read_csv("abfss://MinhTRanWorkspace@onelake.dfs.fabric.microsoft.com/MinhTRanLakehouse.Lakehouse/Files/churn/raw/churn.csv")
df.head()

 However, the Spark read still did not work. It still complaint about authentication failed and not presented in the request when reading a CSV file

 

{"error":{"code":"Unauthorized","message":"Authentication Failed with Bearer token is not present in the request"}}

Do you know what was missing with the Spark read?

 

Thanks,

Du

 

##df = (
##    spark.read.option("header", True)
##    .option("inferSchema", True)
##    .csv("/lakehouse/default/Files/churn/raw/churn.csv") 
##    .cache()   
##)


df = spark.read.format ("csv").option("header","true").load ("/lakehouse/default/Files/churn/raw/churn.csv")

 

 

Hello,

   It worked! I I used the spark read api to load data from csv file from the lakehouse.

 

df = spark.read.format("csv").option("header","true").load("Files/churn/raw/churn.csv")
display(df)

Thanks,

Du

 

Helpful resources

Announcements
December Fabric Update Carousel

Fabric Monthly Update - December 2025

Check out the December 2025 Fabric Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.