Do you have CLI can change ADLS 2's directory owning user?

JH 5 Reputation points
2023-06-13T13:04:34.08+00:00

I saw we can use Azure Storage Explorer to change the owner of a directory or a file.
https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-explorer-acl#manage-an-acl

However, I cannot find the same operation in other ways which includes CLI, python, or PowerShell. Others only provide a way to add new entries instead of changing the owner.

Azure Data Lake Storage
Azure Data Lake Storage
An Azure service that provides an enterprise-wide hyper-scale repository for big data analytic workloads and is integrated with Azure Blob Storage.
1,562 questions
{count} vote

1 answer

Sort by: Most helpful
  1. PRADEEPCHEEKATLA 90,661 Reputation points Moderator
    2023-06-14T06:08:12.3833333+00:00

    @JH - Thanks for the question and using MS Q&A platform.

    According to this article: Access control lists (ACLs) in Azure Data Lake Storage Gen2 - To set file and directory level permissions, see any of the following articles:

    User's image

    Yes, you can use Azure CLI to change the owning user of a directory in Azure Data Lake Storage Gen2. You can use the az storage fs access set command to update the owning user and group of a directory or file by setting the --owner or group parameters to the entity ID or User Principal Name (UPN) of a user.

    Here is an example command to change the owner of a directory.

    az storage fs access set --acl "user::rw-,group::rw-,other::-wx" -p my-directory -f my-file-system --account-name mystorageaccount --auth-mode login
    
    

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.