Forum Discussion
Arundhati_Sen1
1 year agoFrequent Visitor
Error while reading XLSX file into dataframe using pandas
Hi, I have an Excel file (XLSX) in my lakehouse I'm trying to read this file into a pandas dataframe. I need to use the abfss path as the lakehouse is not the default one mapping_file_path = 'abfs...
- 1 year ago
No it didn't help. I have changed my source file type to json now and after that I am not facing any Unauthorization issue
Arundhati_Sen1
1 year agoFrequent Visitor
Hi v-saisrao-msft
I am following https://www.youtube.com/watch?v=sjCDtDHej90&t=144s which shows how to read excel file from lakehouse
Normally reading the file from lakehouse :
pd.read_excel(mapping_file_path, header=0, sheet_name=0, dtype=str)
Regarding below points, how do I do that? Can you share any example for below please:
Regarding below points, how do I do that? Can you share any example for below please:
- Please ensure that the authentication token has a sufficiently long expiration time and is set to refresh automatically if required. If you are using the DefaultAzureCredential or a custom authentication mechanism, confirm the token's expiry and refresh it proactively.
- Please verify your configuration settings to confirm they are correctly set up for authentication.
v-saisrao-msft
1 year agoCommunity Support
Hi Arundhati_Sen1,
- Authentication tokens expire after a set period (usually 1 hour), which can cause issues in long-running or idle processes. DefaultAzureCredential should automatically handle token renewal if implemented correctly. For custom authentication, check and refresh the token before it expires. If using a service principal, ensure periodic token refresh to maintain continuous access.
- Make sure your user account or service principal has the required roles, like Storage Blob Data Reader for read access or Storage Blob Data Contributor for read/write access. Confirm that the abfss:// path is correctly formatted and points to the correct file in the Lakehouse.
If this post helps, then please give us ‘Kudos’ and consider accepting it as a solution to help other members find it more quickly.
Thank you.