locked
How to Upload Files from Local Folder(local machine) to ADL Gen2 using ADF RRS feed

  • Question

  • Please let me know how to Upload Files from Local Folder(local machine) to  ADL Gen2 using C#.NET 

    I'm getting an error WebException: The remote name could not be resolved: 'ADLSGeneration2.azuredatalakestore.net'

    Sample Code trying to upload files 

    ====================

            private static DataLakeStoreFileSystemManagementClient adlsFileSystemClient;
           private static string clientId = "dfdsafdsafdsfsdf";
           private static string clientSecret = "asdfadsfdsafsadf";
            private static string tenantId = "adsfdsafdsafdsfsafasdf436";
            private static string adlsAccountName = "ADLSGeneration2";

            private static void Main(string[] args)
            {
                SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
                var clientCredential = new ClientCredential(clientId, clientSecret);
                var creds = ApplicationTokenProvider.LoginSilentAsync(tenantId, clientCredential).Result;
                adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(creds);
                var source = @"C:\sureshsm\source.txt";
                var destination = @"data\FileUploads\destination.txt";
                adlsFileSystemClient.FileSystem.UploadFile(adlsAccountName, source, destination, 1, false, true);
                //in this line throwing an error message "The remote name could not be resolved"  ,actually trying to upload files into ADLS Gen2 BlobContainer , i tried with blobclinet also facing the same problem
                Console.WriteLine("6. Finished!");




    • Edited by suresh sm Wednesday, April 24, 2019 1:23 AM
    Tuesday, April 23, 2019 7:56 PM

Answers

  • Hi Suresh,

    Looks like you are using ADLS gen1 SDK. ADLS gen 2 is a specialized blob storage service with added features for analytics. Hence you can normally copy files to a container as you would to for a Blob Storage container.

    Please have a look at this doc to read more about Blob connector in ADF.

    As an alternate, you can also consider doing it using rest APIs for ADLS gen2. Please have a look at the proposed answer on this thread. I have posted a comprehensive step-by-step guide to use ADLS Gen2 REST APIs.

    Let us know if this helps. Else we can gladly continue to dive deeper.


    MSDN


    Wednesday, April 24, 2019 11:15 AM

All replies

  • Hi Suresh,

    Looks like you are using ADLS gen1 SDK. ADLS gen 2 is a specialized blob storage service with added features for analytics. Hence you can normally copy files to a container as you would to for a Blob Storage container.

    Please have a look at this doc to read more about Blob connector in ADF.

    As an alternate, you can also consider doing it using rest APIs for ADLS gen2. Please have a look at the proposed answer on this thread. I have posted a comprehensive step-by-step guide to use ADLS Gen2 REST APIs.

    Let us know if this helps. Else we can gladly continue to dive deeper.


    MSDN


    Wednesday, April 24, 2019 11:15 AM
  • We will try with Data Factory or Rest API and get back if any issues


    • Edited by suresh sm Thursday, April 25, 2019 3:17 AM
    Wednesday, April 24, 2019 7:30 PM
  • Hi Suresh,

    Just wanted to check - did your query get resolved using the above suggestion? 

    If the above answer was helpful, please click “Mark as Answer” AND/or “Up-Vote”, as it might be beneficial to other community members reading this thread.
    Monday, May 6, 2019 9:03 AM
  • Resolved. Thanks for your support chirag.

    suresh sm

    Tuesday, May 7, 2019 11:01 PM