Reputation: 608
I am trying to download a file from data lake store, here is the code I used:
_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);
I am getting this exception: Exception thrown: 'Microsoft.Rest.TransientFaultHandling.HttpRequestWithStatusException' in mscorlib.dll
Additional information: Response status code indicates server error: 403 (Forbidden).
I have assigned my app read/write/execute access on Rnds folder and all its files. did I miss anything?
Thanks.
Upvotes: 1
Views: 2840
Reputation: 965
In addition to the permissions on the Rnds folder and files, you also need Execute (X) permission on all the ancestors of Rnds.
See Permissions needed to read a file in this document here:
https://learn.microsoft.com/en-us/azure/data-lake-store/data-lake-store-access-control
Upvotes: 1