Forum Discussion

smpa01's avatar
smpa01
Community Champion
1 year ago
Solved

Accessing one lake

As per the doc  python can access onelake progrmatically. So I tried this to access the files in a directory like from azure.storage.filedatalake import ( DataLakeServiceClient, DataLakeDi...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi smpa01 ,

     

    Thanks for providing those details and code examples, your understanding is logical, but here’s where the key difference lies:

    Although OneLake is built on ADLS Gen2 and supports the same APIs and SDKs, it does not support SAS token authentication. OneLake exclusively uses Microsoft Entra ID (Azure AD)-based authentication, which is more secure and aligned with Fabric’s enterprise governance model.

    So while you can continue to use DataLakeServiceClient, you must authenticate using a supported credential type like ClientSecretCredential or DefaultAzureCredential with a registered service principal.

    To enable this:

    1. Use your SPN and authenticate via Entra ID (no SAS tokens).
    2. Ensure your SPN has at least Viewer or Member role assigned to the Lakehouse item in the Fabric workspace via “Manage Access”.
    3. Use endpoint:
      https://<workspace-name>.dfs.fabric.microsoft.com

    While the APIs are compatible, the authentication model is not, and that’s the main reason your current Databricks pattern doesn’t apply directly to OneLake.

     

    If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

     

    Thankyou.