Azure Data Lake Folder listing issue

0

I am able to list the folders and get the files in Windows 10 environment using Visual Studio 2017 (C#). But I am getting the below error while list the folders from ADLS in Windows Server 2016 with the same dot net code. I have SQL Server 2016 Installed in the Windows Server 2016.

    var creds = ApplicationTokenProvider.LoginSilentAsync(tenantId, applicationId, secretKey).Result;
      AdlsClient adlsClient = AdlsClient.CreateClient(adlsAccountName, creds);
      var lstPPLSubFolders = adlsClient.EnumerateDirectory(strFactoryPath);
      var lstMachineFolders = lstPPLSubFolders.Where(p => !p.FullName.Contains("/Global"));
      foreach (var machineFolder in lstMachineFolders)
       {
                Console.WriteLine(machineFolder.FullName.ToString());
       }   


 **Error: Microsoft.Azure.DataLake.Store.AdlsException**
      HResult=0x80131620
      Message=Error getting listStatus for path /raw/myfolder/ after 
    Operation: LISTSTATUS failed with   Unknown Error: The 'User-Agent' header must be modified using the appropriate property or method.
    Parameter name: name Source: System StackTrace:    at 



 System.Net.WebHeaderCollection.ThrowOnRestrictedHeader(String headerName)
           at System.Net.WebHeaderCollection.Set(String name, String value)
           at 


Microsoft.Azure.DataLake.Store.WebTransport.AssignCommonHttpHeaders(HttpWebRequest webReq, AdlsClient client, RequestOptions req, String token, String opMethod, IDictionary`2 customHeaders, Int32 postRequestLength)
           at Microsoft.Azure.DataLake.Store.WebTransport.<MakeSingleCallAsync>d__22.MoveNext().

Last encountered exception thrown after 5 tries. [The 'User-Agent' header must be modified using the appropriate property or method. Parameter name: name,The 'User-Agent' header must be modified using the appropriate property or method. Parameter name: name,The 'User-Agent' header must be modified using the appropriate property or method.

c#
azure
azure-data-lake
asked on Stack Overflow Jan 29, 2019 by Lakshman • edited Feb 16, 2019 by Mohit Verma

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0