Azure-docs: How can we set an ACL on a file system?

Created on 6 May 2020  Â·  12Comments  Â·  Source: MicrosoftDocs/azure-docs

Hello,

I'm trying to set an ACL for a container but it is mandatory to fill the parameter "Path". In the documentation there is an example and in the command there is no parameter "Path". Can someone help me, please?

$resourceGroup = "rg-dsv-brs"
$storageAccountName = "dlsfilesdsv"
$containerName = "raw"
$directoryName = "files"
$objectid = "0xx8xbx5-9863-4687-adcc-aed20db0043e"

$storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroup -Name $storageAccountName
$ctx = $storageAccount.Context

$acl = New-AzDataLakeGen2ItemAclObject -AccessControlType group -EntityId $objectid -Permission r-x
Update-AzDataLakeGen2Item -Context $ctx -FileSystem $containerName -Acl $acl

command-error


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 assigned-to-author data-lake-storage-gensubsvc product-question storagsvc triaged

All 12 comments

@crisansou Thanks for your question. We are checking on this and will respond to you soon.

@crisansou The example you have pointed out talks about applying ACLs at the File System Level. However, in your case, you need to set it a directory level (the next example talks about the same and the code sample includes Path parameter passed to the cmdlet.

image

Hope this helps.

@crisansou The example you have pointed out talks about applying ACLs at the File System Level. However, in your case, you need to set it a directory level (the next example talks about the same and the code sample includes Path parameter passed to the cmdlet.

image

Hope this helps.

Hi @ChiragMishra-MSFT,

I'll try to explain the problem, I created a group that should have access in container "raw" and in directory "marketing", that's why I want to know how to set an ACL on a file system. If I use the command "Update-AzDataLakeGen2Item -Context $ctx -FileSystem $containerName -Path $directoryName -Acl $acl" that gives access only in the directory "marketing" the user will not be able to access it because he doesn't have access in the container "raw". Do you know how to set an ACL on a file system? I can't run the command "Update-AzDataLakeGen2Item -Context $ ctx -FileSystem $ containerName -Acl $ acl" without filling in the "Path" parameter as shown below:

command-error

But the documentation says it is possible:

image

Best regards,
Cristina

Hi @crisansou please refer to this article section - Common scenarios related to permissions. It describes the level of permissions required to achieve certain scenarios. In the case of directory permissions you have to give execute permission to the container that contains the directory. Execute perms on the container enables the user to traverse and see the directory in the container.

Hi @crisansou please refer to this article section - Common scenarios related to permissions. It describes the level of permissions required to achieve certain scenarios. In the case of directory permissions you have to give execute permission to the container that contains the directory. Execute perms on the container enables the user to traverse and see the directory in the container.

Hello @normesta ,

This is exactly what I want to do, but I can't give permission on the container, it is mandatory to fill in the "Path" parameter.

command-error

Best regards,
Cristina

@crisansou this is definitely strange. I just ran the same command without receiving that error message. Are you using a previous version of this module (perhaps the preview module)?

@crisansou this is definitely strange. I just ran the same command without receiving that error message. Are you using a previous version of this module (perhaps the preview module)?

Hello @normesta,

I'm using version 1.14.0 and you?

Best regards,
Cristina

image

I'm using the same version. @blueww is it a bug or known issue that an attempt to update the ACL of a file system prompts for a path? I'm using the same build as Cristina but I cannot repro the issue.

@crisansou , @normesta
Please run Get-Module after the issue happen, see if any other version of Az.Storage module imported.Find-module is to find the module can be installed, it can't show which module is installed or imported.

Update-AzDataLakeGen2Item without FileSystem only works on Az.Storage 1.14.0 or later.

@crisansou , @normesta
Please run Get-Module after the issue happen, see if any other version of Az.Storage module imported.Find-module is to find the module can be installed, it can't show which module is installed or imported.

Update-AzDataLakeGen2Item without FileSystem only works on Az.Storage 1.14.0 or later.

Hi @blueww and @normesta ,

Thank you very much! There is a preview version, I'll try to remove it.

image

As there is a version problem, I successfully ran the commands using Cloud Shell.

image

Best regards,
Cristina

I installed version 1.14.0 and the problem was resolved.

image

@blueww Thank you so much! That was very informative.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Favna picture Favna  Â·  3Comments

monteledwards picture monteledwards  Â·  3Comments

ianpowell2017 picture ianpowell2017  Â·  3Comments

bdcoder2 picture bdcoder2  Â·  3Comments

jamesgallagher-ie picture jamesgallagher-ie  Â·  3Comments