2
votes

I'm trying to upload files from a shared folder to an Azure Datalake gen 1 folder.

For now, i am just testing the connection, and listing folders under the root directory:

adlCreds = lib.auth(tenant_id = tenant_id, client_secret = client_secret, client_id = client_id, resource = RESOURCE, azure_username = azure_username,azure_password=azure_password)

adls = core.AzureDLFileSystem(adlCreds, store_name=adlsAccountName)

print(adls.ls())

That works fine and i can see all folders.

But when i am trying to access one of those folders with the ls method or the walk method, i am getting this error:

Traceback (most recent call last):
  File "C:\Users\Python37-32\test_azure.py", line 46, in <module>
    print(adls.ls('/Test'))
  File "C:\Users\Python37-32\lib\site-packages\azure\datalake\store\core.py", line 164, in ls
    files = self._ls(path, invalidate_cache)
  File "C:\Users\Python37-32\lib\site-packages\azure\datalake\store\core.py", line 143, in _ls
    self.dirs[key] = self._ls_batched(key, batch_size=batch_size)
  File "C:\Users\Python37-32\lib\site-packages\azure\datalake\store\core.py", line 124, in _ls_batched
    ls_call_result = self.azure.call('LISTSTATUS', path, **parms)
  File "C:\Users\Python37-32\lib\site-packages\azure\datalake\store\lib.py", line 437, in call
    self.log_response_and_raise(response, PermissionError(path), level=exception_log_level)
  File "C:\Users\Python37-32\lib\site-packages\azure\datalake\store\lib.py", line 345, in log_response_and_raise
    raise exception
PermissionError: Test

I am granted by Read, Write and Execute privileges on the root and the 'Test' folder.

Do you have an idea why the permission is denied ?

Thank you for your time.

2
This error really like you just granted the permission on the root(add to This folder without all children), can you make sure you also granted the permission to Test folder?Joy Wang
Thanks a lot, that was the issue. The option for apply permision to children was'nt checked. It works now.Dave

2 Answers

2
votes

Add my comment as an answer:

The error was caused by you just granted the permission on the root(add to This folder without all children), you also need to grant the permission for all children, then it will work.

0
votes

In addition to the permissions on the X folder and files, you also need Execute (X) permission on all the ancestors of X.

You can read further about permission required to read files here

Permissions needed to read a file in this document here:

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