<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to read/write to Onelake lakehouse using function app in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-read-write-to-Onelake-lakehouse-using-function-app/m-p/4030355#M2889</link>
    <description>&lt;P&gt;Hello Everyone, I want to read files from Onelake lakehouse in my function app or local setup, can someone help me connect to the lakehouse and get the files, also I would want to write some data back to the lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know we can refer to the storage similar to the ADLS gen2, but how do I authenticate my client to get the files from the Lakehouse, what permissions are needed to do so ?&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 13:27:32 GMT</pubDate>
    <dc:creator>AdarshPanasri</dc:creator>
    <dc:date>2024-07-08T13:27:32Z</dc:date>
    <item>
      <title>How to read/write to Onelake lakehouse using function app</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-read-write-to-Onelake-lakehouse-using-function-app/m-p/4030355#M2889</link>
      <description>&lt;P&gt;Hello Everyone, I want to read files from Onelake lakehouse in my function app or local setup, can someone help me connect to the lakehouse and get the files, also I would want to write some data back to the lakehouse.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know we can refer to the storage similar to the ADLS gen2, but how do I authenticate my client to get the files from the Lakehouse, what permissions are needed to do so ?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 13:27:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-read-write-to-Onelake-lakehouse-using-function-app/m-p/4030355#M2889</guid>
      <dc:creator>AdarshPanasri</dc:creator>
      <dc:date>2024-07-08T13:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to read/write to Onelake lakehouse using function app</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-read-write-to-Onelake-lakehouse-using-function-app/m-p/4031380#M2901</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/763823"&gt;@AdarshPanasri&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To connect to OneLake Lakehouse and perform read/write operations, you can follow the steps below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use &lt;STRONG&gt;Microsoft Entra ID&lt;/STRONG&gt; to authenticate your client.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a Python example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;First, run the following statement to install the required packages.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;pip install azure-identity azure-storage-file-datalake&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To authenticate, replace &amp;lt;your-tenant-id&amp;gt;, &amp;lt;your-client-id&amp;gt;, and &amp;lt;your-client-secret&amp;gt; with your actual tenant ID, client ID, and client secret, respectively.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;from azure.identity import ClientSecretCredential
from azure.storage.filedatalake import DataLakeServiceClient

tenant_id = "&amp;lt;your-tenant-id&amp;gt;"
client_id = "&amp;lt;your-client-id&amp;gt;"
client_secret = "&amp;lt;your-client-secret&amp;gt;"

credential = ClientSecretCredential(tenant_id, client_id, client_secret)
service_client = DataLakeServiceClient(account_url=https://&amp;lt;your-account-name&amp;gt;.dfs.core.windows.net, credential=credential)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding identity verification, this article may be helpful to you:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dataroots.io/blog/how-to-use-service-principal-authentication-to-access-microsoft-fabrics-onelake" target="_blank"&gt;How to use service principal authentication to access Microsoft Fabric's OneLake (dataroots.io)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding your question about permissions, there are two aspects.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read permissions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;ReadData permissions on SQL endpoints to access data without SQL policies.&lt;/LI&gt;
&lt;LI&gt;ReadAll permissions for all data in the lake warehouse using Apache Spark.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Write permissions:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;You need to be assigned one of the following roles in your workspace: Admin, Member, or Contributor.&lt;BR /&gt;&lt;BR /&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If you have any questions or need further help, feel free to contact me!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2024 02:10:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/How-to-read-write-to-Onelake-lakehouse-using-function-app/m-p/4031380#M2901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-09T02:10:48Z</dc:date>
    </item>
  </channel>
</rss>

