<?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 Re: Uploading Files using .Net in C# in Data Engineering</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4719908#M9902</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Although it seems to indicate a file extension issue, this message is often returned when intermediate directories in the file path do not exist and haven't been explicitly created before attempting the upload. Azure Data Lake Gen2 does not automatically create nested directories&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;above dlToFolder is pointing to "my-datalake", and then you're asking it to upload a file under a nested path "File/Subfolder1/SubFolder2/MyFile.txt"&amp;nbsp;without creating those folders (File, Subfolder1, SubFolder2) explicitly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you try making below changes to code and let me if your able to resolve your issue:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DefaultAzureCredential credential = new();
DataLakeServiceClient dlServClient = new(new Uri(sLakeURL), credential);

// Get the file system client
DataLakeFileSystemClient dlFileSysClient = dlServClient.GetFileSystemClient("my-workspace");

// Create/get the root directory (e.g., "my-datalake")
DataLakeDirectoryClient dlRootFolder = dlFileSysClient.GetDirectoryClient("my-datalake");
await dlRootFolder.CreateIfNotExistsAsync(); //

// Create the intermediate subdirectories
DataLakeDirectoryClient level1 = await dlRootFolder.CreateSubDirectoryAsync("File");
DataLakeDirectoryClient level2 = await level1.CreateSubDirectoryAsync("Subfolder1");
DataLakeDirectoryClient level3 = await level2.CreateSubDirectoryAsync("SubFolder2");

// Get the file client at the final path
DataLakeFileClient file = level3.GetFileClient("MyFile.txt");

// Upload the file
await file.UploadAsync("MyFile.txt", overwrite: true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Prashanth Are&lt;/P&gt;
&lt;P&gt;MS Fabric community support&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 13:03:16 GMT</pubDate>
    <dc:creator>v-prasare</dc:creator>
    <dc:date>2025-06-04T13:03:16Z</dc:date>
    <item>
      <title>Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4718862#M9872</link>
      <description>&lt;P&gt;I am attempting to upload file using the Azure.Storage.Files.DataLake library from NuGet. I am getting am error that I cannot make sense of. Here is what I have...&lt;/P&gt;&lt;P&gt;DefaultAzureCredential credential = new();&lt;BR /&gt;DataLakeServiceClient dlServClient = new(new Uri(sLakeURL), credential);&lt;BR /&gt;DataLakeFileSystemClient dlFileSysClient = dlServClient.GetFileSystemClient("my-workspace");&lt;BR /&gt;DataLakeDirectoryClient dlToFolder = dlFileSysClient.GetDirectoryClient("my-datalake");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DataLakeFileClient file = dlToFolder.GetFileClient("File/Subfolder1/SubFolder2/MyFile.txt");&lt;BR /&gt;file.Upload("MyFile.txt", overwrite:true);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I get this error "Request Failed with Required item type extension is missing in the item name. Expected format {itemname}.{itemtype}". But, obviously the filename has an extension on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jun 2025 21:36:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4718862#M9872</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-03T21:36:12Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4719908#M9902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Although it seems to indicate a file extension issue, this message is often returned when intermediate directories in the file path do not exist and haven't been explicitly created before attempting the upload. Azure Data Lake Gen2 does not automatically create nested directories&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;above dlToFolder is pointing to "my-datalake", and then you're asking it to upload a file under a nested path "File/Subfolder1/SubFolder2/MyFile.txt"&amp;nbsp;without creating those folders (File, Subfolder1, SubFolder2) explicitly.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Can you try making below changes to code and let me if your able to resolve your issue:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;DefaultAzureCredential credential = new();
DataLakeServiceClient dlServClient = new(new Uri(sLakeURL), credential);

// Get the file system client
DataLakeFileSystemClient dlFileSysClient = dlServClient.GetFileSystemClient("my-workspace");

// Create/get the root directory (e.g., "my-datalake")
DataLakeDirectoryClient dlRootFolder = dlFileSysClient.GetDirectoryClient("my-datalake");
await dlRootFolder.CreateIfNotExistsAsync(); //

// Create the intermediate subdirectories
DataLakeDirectoryClient level1 = await dlRootFolder.CreateSubDirectoryAsync("File");
DataLakeDirectoryClient level2 = await level1.CreateSubDirectoryAsync("Subfolder1");
DataLakeDirectoryClient level3 = await level2.CreateSubDirectoryAsync("SubFolder2");

// Get the file client at the final path
DataLakeFileClient file = level3.GetFileClient("MyFile.txt");

// Upload the file
await file.UploadAsync("MyFile.txt", overwrite: true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Prashanth Are&lt;/P&gt;
&lt;P&gt;MS Fabric community support&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:03:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4719908#M9902</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-06-04T13:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4719914#M9903</link>
      <description>&lt;P&gt;The destination folders do already exist. However I am not quite sure where the root begins. The Data Lake already creates Tables and Files folders. I am not sure when I connect to I start with "Files/Subfolder1/Subfolder2/Filename.txt" or&amp;nbsp;"Subfolder1/Subfolder2/Filename.txt". I'm sure I have tried both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could it also be the cred, I am working on a machine that is not part of the Entra domain where the lakehouse resides. I have a service Id and pwd that does not require MFA to use but I cannot figure out how to do it.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 13:18:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4719914#M9903</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-04T13:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4723214#M9969</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P data-start="385" data-end="460"&gt;When you connect using a DataLakeServiceClient or DataLakeFileSystemClient, hierarchy starting at the container level (i.e., the Fabric Lakehouse’s Files or Tables&amp;nbsp;container). If you're working in the Files area, you must start your path with "Files/"&lt;/P&gt;
&lt;P&gt;"Files/Subfolder1/Subfolder2/MyFile.txt"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're working on a machine that’s not Entra-joined and have a &lt;STRONG data-start="2356" data-end="2400"&gt;service principal (client ID and secret)&lt;/STRONG&gt; that doesn’t require MFA, the best option is to use the ClientSecretCredential class. This explicitly authenticates using your app registration details in Azure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;using Azure.Identity;
using Azure.Storage.Files.DataLake;

// Replace with your actual values
string tenantId = "&amp;lt;your-tenant-id&amp;gt;";
string clientId = "&amp;lt;your-client-id&amp;gt;";
string clientSecret = "&amp;lt;your-client-secret&amp;gt;";
string lakeUrl = "https://&amp;lt;your-storage-account-name&amp;gt;.dfs.core.windows.net";

// Authenticate using client credentials
var credential = new ClientSecretCredential(tenantId, clientId, clientSecret);
var serviceClient = new DataLakeServiceClient(new Uri(lakeUrl), credential);

// Connect to the container (Lakehouse workspace)
var fileSystemClient = serviceClient.GetFileSystemClient("my-workspace");

// Set the directory path including the logical 'Files' container
var directoryClient = fileSystemClient.GetDirectoryClient("Files/Subfolder1/Subfolder2");
await directoryClient.CreateIfNotExistsAsync();

// Upload the file
var fileClient = directoryClient.GetFileClient("MyFile.txt");
using var stream = File.OpenRead("MyFile.txt");
await fileClient.UploadAsync(stream, overwrite: true);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Replace:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&amp;lt;your-tenant-id&amp;gt; — from Azure AD&lt;/LI&gt;
&lt;LI&gt;&amp;lt;your-service-principal-client-id&amp;gt; — app registration's "Application (client) ID"&lt;/LI&gt;
&lt;LI&gt;&amp;lt;your-secret&amp;gt; — from app registration &amp;gt; Certificates &amp;amp; secrets&lt;/LI&gt;
&lt;LI&gt;&amp;lt;your-storage-account&amp;gt; — name of the account (you’ll see this in Fabric if you dig into the linked lakehouse)&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Prashanth Are&lt;/P&gt;
&lt;P&gt;MS Fabric community support&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Jun 2025 13:22:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4723214#M9969</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-06-06T13:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4725793#M10031</link>
      <description>&lt;P&gt;For now I have aboned this project since logging in using a User Id and a Passward without MFA. Is a royal pain.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jun 2025 13:06:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4725793#M10031</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-09T13:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4727093#M10053</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/213397"&gt;@spartan27244&lt;/a&gt;,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the confirmation, we understand your pain in this scenario.&amp;nbsp;&lt;SPAN data-teams="true"&gt;I’d encourage you to submit your detailed feedback and ideas via Microsoft's official feedback channels, such as the &lt;A class="" title="https://ideas.fabric.microsoft.com/ideas/search-ideas/" href="https://ideas.fabric.microsoft.com/ideas/search-ideas/" target="_blank" rel="noreferrer noopener" aria-label="Link Microsoft Fabric Ideas"&gt;&lt;STRONG&gt;Microsoft Fabric Ideas.&lt;/STRONG&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;SPAN data-teams="true"&gt;&amp;nbsp;Feedback submitted here is often reviewed by the product teams and can lead to meaningful improvement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;Prashanth Are&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN data-teams="true"&gt;MS Fabric community support&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jun 2025 11:32:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4727093#M10053</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-06-10T11:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4730069#M10092</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We are following up once again regarding your query. Could you please confirm if you have shared ideas with Microsoft?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the you have any progress, we kindly request you to share the resolution or key insights here to help others in the community. If we don’t hear back, we’ll go ahead and close this thread.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Should you need further assistance in the future, we encourage you to reach out via the Microsoft Fabric Community Forum and create a new thread. We’ll be happy to help.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for your understanding and participation.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 10:57:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4730069#M10092</guid>
      <dc:creator>v-prasare</dc:creator>
      <dc:date>2025-06-12T10:57:16Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading Files using .Net in C#</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4730551#M10115</link>
      <description>&lt;P&gt;I have not done any followup with Microsoft, I really don't know how, but I have just tabled this project. At this point we are evaluating if fabric is even something we want to continue to pursue.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jun 2025 17:07:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Engineering/Uploading-Files-using-Net-in-C/m-p/4730551#M10115</guid>
      <dc:creator>spartan27244</dc:creator>
      <dc:date>2025-06-12T17:07:29Z</dc:date>
    </item>
  </channel>
</rss>

