Azure - ADlsError / WebHDFS error while deleting ADLS file.


  • Hi,

    I am using C# for ADLS authentication and wants to do some file operation like delete, rename. Using below code for authentication and delete operation

                    var context = new AuthenticationContext("" + tenantId);
                    ClientCredential clientCredential = new ClientCredential(appId, secretKey);
                    var tokenResponse = context.AcquireTokenAsync("", clientCredential).Result;
                    var accessToken = tokenResponse.AccessToken;
                    using (var client = new HttpClient())
                        client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);
                        client.BaseAddress = new Uri("");

                    ServiceClientCredentials creds = new TokenCredentials(tokenResponse.AccessToken);// tokenResponse.IdToken, tokenResponse.AccessTokenType);

                    DataLakeStoreFileSystemManagementClient _adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(creds);

                    _adlsFileSystemClient.FileSystem.Delete(_adlsAccountName, FilenameWPath);

    I am getting AdlsError, 

    > An unhandled exception of type
    > 'Microsoft.Azure.Management.DataLake.Store.Models.AdlsErrorException'
    > occurred in ConsoleApplication1.exe

    which mean WebHDFS should be enabled? How to enable webHDFS on ADLS. I checked the HDInight, webHDFS is enabled.

    Please let me know, How I can rectify this problem.
    • Edited by aj8102 Monday, December 26, 2016 11:54 AM
    • Moved by Swikruti Bose Monday, December 26, 2016 5:13 PM Related to Data Lake
    Monday, December 26, 2016 11:06 AM

All replies

  • Hi,

    WebHDFS doesn't have to be explicitly enabled for Data Lake Store; it looks like there's a different error happening that we're able to explore by taking a look at the exception details.  Could you share any details from the AdlsErrorException exception object that is thrown?  There should be details within the exception object with more information.  Please feel free to remove any sensitive information from the contents before pasting here.

    You may want to ensure that you're using the authentication code that is shown in this article, to simplify things.  For example, you shouldn't need to create an HttpClient object yourself.

    I recommend also double-checking that your service principal has permissions on the data that you're trying to access.  Please see this article for more information on how to give permissions to data in Azure Data Lake Store.

    I hope this helps!  Please let us know if you have any questions or if we can help further.


    Azure Data Lake

    Saturday, January 7, 2017 12:05 AM