我正在使用C#进行ADLS身份验证,并希望做一些文件操作,如删除,重命名。用下面的代码进行验证和删除操作Azure - ADlsError/WebHDFS错误,同时删除ADLS文件
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);
我越来越AdlsError,
类型的未处理的异常 “Microsoft.Azure.Management.DataLake.Store.Models.AdlsErrorException” 发生在ConsoleApplication1.exe
这意味着WebHDFS应该启用?如何在ADLS上启用webHDFS。我检查了HDInight,启用了webHDFS。
请让我知道,我该如何解决这个问题。
我说我为“数据分析湖开发者”的角色,一切角色是工作的罚款...感谢汤姆你的努力。你能帮助我http://stackoverflow.com/questions/41330565/u-sql-error-while-using-reference-assembly?noredirect=1 – Ajay