首页 > 解决方案 > 授予 StorageV2 目录中的用户访问权限(通用 v2)

问题描述

StorageV2(通用v2)中有一些目录如下图

图片

我的角色是贡献者 我想授予用户读取 W 名为“2000”的目录及其所有子目录的权限 我该怎么做?Powershell可以做到这一点吗?

如果你能帮忙就太好了

标签: azurepowershellazure-active-directoryazure-powershellazure-data-lake

解决方案


您可以使用可在 Powershell 中运行的Azure CLI执行此操作。作为贡献者,您应该能够使用该az role assignment create命令执行此操作。

请记住,此命令的权限是在容器范围内授予的。Data Lake 存储可用于授予文件夹级别权限。Blob 存储实际上没有文件夹,它只是以这种方式显示,以便于导航。

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>"

推荐阅读