Search code examples
azurepowershellazure-active-directoryazure-powershellazure-data-lake

give acess to users in directory StorageV2 (general purpose v2)


there are some directories in StorageV2 (general purpose v2) as shown below

image

My role is contributor I want to give access for a user to read W the directory named '2000' and all its subdirectories How can I do this? Is this possible with Powershell.

It would be really nice if you can help


Solution

  • You can do this with the Azure CLI which can be run in Powershell. You should be able to do this as a contributor with the az role assignment create command.

    Keep in mind that permissions with this command are granted at the container scope. Data Lake storage could be used to give folder level permissions. Blob storage doesn't actually have folders, it's just displayed that way so that it is easier to navigate.

    az role assignment create \
        --role "Storage Blob Data Contributor" \
        --assignee <email> \
        --scope "/subscriptions/<subscription>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/blobServices/default/containers/<container>"