You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the permission needed for remove_acl_entries()? The action fails with a service principal, even it already has RWX permission, also the storage owner
#331
Open
DorisTao77 opened this issue
Dec 8, 2023
· 0 comments
Try to authenticate with a service principal in the codes. The service principal has already been given the owner IAM role of the ADLS gen1 storage. Also, it has RWX permission on the folder/files.
But it still fails to remove the ACL entries with the remove_acl_entries() function.
Traceback (most recent call last):
File "C:\Users\xinrantao\PycharmProjects\pythonProject\acl_remove_test.py", line 42, in
main()
File "C:\Users\xinrantao\PycharmProjects\pythonProject\acl_remove_test.py", line 38, in main
adl.remove_acl_entries("/testfolder1", "user:518b91c4-a815-409d-8915-ad6249f5095d", recursive=False, number_of_sub_process=None)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\core.py", line 534, in remove_acl_entries
self._acl_call('REMOVEACLENTRIES', path, acl_spec, invalidate_cache=True)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\core.py", line 459, in _acl_call
to_return = self.azure.call(action, posix_path, **parms)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\lib.py", line 450, in call
self.log_response_and_raise(response, PermissionError(path), level=exception_log_level)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\lib.py", line 358, in log_response_and_raise
raise exception
PermissionError: testfolder1
Reproduction Steps
create the service principal, give it the owner IAM role of the ADLS gen1 storage:
It has the RWX permission to the folder, which needs to remove the ACL entries:
Use the service principal as the authentication, try to remove the ACL entries of this folder from one of the user:
it's interesting to find that if giving the owner of this specific folder to this service principal, then it seems to work.
Could you help check what's the minimum permission needed for this action? Is the owner of the folder/file necessary?
If it's necessary, how to give the owner of all the folder/files in a quick way? Because currently it relies on the service principal as authentication to remove all the ACL entries automatically. Thanks!
Environment summary
SDK Version: What version of the SDK are you using? (pip show azure-datalake-store)
Answer here: 0.0.53
Python Version: What Python version are you using? Is it 64-bit or 32-bit?
Answer here: Python 3.9, 64-bit
OS Version: What OS and version are you using?
Answer here: Windows 11
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: PyCharm
The text was updated successfully, but these errors were encountered:
Description
Try to authenticate with a service principal in the codes. The service principal has already been given the owner IAM role of the ADLS gen1 storage. Also, it has RWX permission on the folder/files.
But it still fails to remove the ACL entries with the remove_acl_entries() function.
Traceback (most recent call last):
File "C:\Users\xinrantao\PycharmProjects\pythonProject\acl_remove_test.py", line 42, in
main()
File "C:\Users\xinrantao\PycharmProjects\pythonProject\acl_remove_test.py", line 38, in main
adl.remove_acl_entries("/testfolder1", "user:518b91c4-a815-409d-8915-ad6249f5095d", recursive=False, number_of_sub_process=None)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\core.py", line 534, in remove_acl_entries
self._acl_call('REMOVEACLENTRIES', path, acl_spec, invalidate_cache=True)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\core.py", line 459, in _acl_call
to_return = self.azure.call(action, posix_path, **parms)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\lib.py", line 450, in call
self.log_response_and_raise(response, PermissionError(path), level=exception_log_level)
File "C:\Users\xinrantao\AppData\Local\Programs\Python\Python39\lib\site-packages\azure\datalake\store\lib.py", line 358, in log_response_and_raise
raise exception
PermissionError: testfolder1
Reproduction Steps
create the service principal, give it the owner IAM role of the ADLS gen1 storage:

It has the RWX permission to the folder, which needs to remove the ACL entries:

Use the service principal as the authentication, try to remove the ACL entries of this folder from one of the user:
Could you help check what's the minimum permission needed for this action? Is the owner of the folder/file necessary?
If it's necessary, how to give the owner of all the folder/files in a quick way? Because currently it relies on the service principal as authentication to remove all the ACL entries automatically. Thanks!
Environment summary
SDK Version: What version of the SDK are you using? (pip show azure-datalake-store)
Answer here: 0.0.53
Python Version: What Python version are you using? Is it 64-bit or 32-bit?
Answer here: Python 3.9, 64-bit
OS Version: What OS and version are you using?
Answer here: Windows 11
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
Answer here: PyCharm
The text was updated successfully, but these errors were encountered: