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("https://login.windows.net/" + tenantId);
ClientCredential clientCredential = new ClientCredential(appId, secretKey);
var tokenResponse = context.AcquireTokenAsync("https://management.azure.com/", clientCredential).Result;
var accessToken = tokenResponse.AccessToken;
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + accessToken);
client.BaseAddress = new Uri("https://management.azure.com/");
}
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.