[FEATURE REQ] Consider a method for moving files that change ACL to match default values of parent directory
See original GitHub issueLibrary or service name. Azure.Storage.Files.DataLake
I would like to move a file between directories or file systems that automatically sets ACL to that of the values specified by the default ACL of the destination.
Current options seem to be:
-
Use
DataLakeFileClient.RenameAsync
then useDataLakeDirectoryClient.GetAccessControlAsync
to get parent’s ACL then useDataLakeFileClient.SetAccessControlListAsync
-
Download file to
MemoryStream
usingDataLakeFileClient.ReadAsync
then upload to a new file usingDataLakeFileClient.AppendAsync
.
Option 1 requires heightened permissions than option 2 and option 2 is less efficient than option 1.
Better options may be:
-
Create a
DataLakeFileClient.MoveAsync
(orDataLakeFileSystemClient.MoveAysnc
) method that works similarly toRenameAsync
but sets ACL to those of the parent’s default ACL (and change owner and group would occur if new file was created), similarly to if a new file was created -
Add a parameter to
DataLakeFileClient.RenameAsync
that allows the resetting of the file’s ACL -
Follow Microsoft.Azure.Storage.Blob v11 lead with a
StartCopy
method.
Pointing out obvious errors in my reasoning is welcomed. Thanks for your consideration and thank you for this great library.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi,
Let me know if I’m incorrect in what you’re saying. Is your ask is to create a convenience method that calls the following methods in these steps.
Rename
on the DataLake fileGetAccessControlList
on the destination folder holding the DataLake FIleSetAccessControlList
on the newly renamed DataLake File (Which means that this method would make three calls to storage)As for the
StartCopy
suggestion, I don’t think that would resolve your request, as you would most likely would have to callDelete
on the source blob afterwards. You would also have to create the destination blob. Also sinceStartCopy
is a blob API and not a datalake API, I don’t think it would be wise to callStartCopy
on a DataLake File. (Also this would take a total of 2 calls instead of 1).I’m not sure if this is a convenience method we want to support (also naming it
Move
doesn’t seem to encompass what the method would do). If there’s more of ask for a convenience method like this, I will reopen this issue/feature request.Thanks for your input! Please let us know if you have any other suggestions or issues.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @sumantmehtams.