Azure Data Lake Store access failure: Response status code indicates server error: 403 (Forbidden)

Azure Data Lake Store access failure: Response status code indicates server error: 403 (Forbidden)

我正在尝试从数据湖存储下载文件,这是我使用的代码:

    _adlsAccountName = "myadls";
    _resourceGroupName = "NavigationResource";
    _location = "East US 2";
    _subId = "myid";
    string localFolderPath = @"E:\temp\"; 
    string localFilePath = Path.Combine(localFolderPath, "modGR_vrt.tsv");
    string remoteFolderPath = "/Rnds/";
    string remoteFilePath = Path.Combine(remoteFolderPath, "modGR_vrt.tsv");

    SynchronizationContext.SetSynchronizationContext(new SynchronizationContext());
    var domain = "microsoft.com"; // any value
    var clientId = "my client id"; // this is a native app
    var clientSecret = "clientSecret"; 
    var clientCredential = new ClientCredential(clientId, clientSecret);
    var creds = ApplicationTokenProvider.LoginSilentAsync(domain, clientCredential).Result;

    _adlsFileSystemClient = new DataLakeStoreFileSystemManagementClient(creds); 

    var result = _adlsFileSystemClient.FileSystem.GetFileStatus(_adlsAccountName, srcPath);

我遇到了这个异常: 抛出异常:'Microsoft.Rest.TransientFaultHandling.HttpRequestWithStatusException' in mscorlib.dll

附加信息:响应状态代码表示服务器错误:403(禁止访问)。

我已为我的应用分配 read/write/execute 对 Rnds 文件夹及其所有文件的访问权限。我错过了什么吗?

谢谢。

除了对Rnds文件夹和文件的权限外,您还需要对Rnds所有祖先的执行(X)权限。

在此处查看此文档中的读取文件所需的权限:

https://docs.microsoft.com/en-us/azure/data-lake-store/data-lake-store-access-control