简体   繁体   English

使用 Azure CLI 将用户权限添加到 Data Lake Store Gen2 文件夹

[英]Add user rights to Data Lake Store Gen2 Folder with Azure CLI

We would like to set specific rights to an enterprise application in DataLake Gen2 using Azure CLI in our deployment Pipeline.我们想在我们的部署管道中使用 Azure CLI 为 DataLake Gen2 中的企业应用程序设置特定权限。 We use powersehell 7.0 and the az storage extension.我们使用 powersehell 7.0 和 az storage 扩展。

I can set rights for users, groups and other via cli, but not for a specific user.我可以通过 cli 为用户、组和其他设置权限,但不能为特定用户设置权限。 This user must must have a contributor role (rw-)此用户必须具有贡献者角色 (rw-)

I have tried to set the rights:我试图设置权限:

az extension add --name storage-preview
az storage blob directory access set -a "default:$user::rw-" -d $dirname -c $filesystemName --account-name $storageaccountname

But it trows the error:'error":{"code":"InvaldAccessControlList","message":"The access control list value is invalid'但它抛出错误:'error":{"code":"InvaldAccessControlList","message":"访问控制列表值无效'

When run运行时

az storage blob directory access show -d $dirname  -c $filesystemName  --account-name $storageaccountname
{
  "acl": "user::rwx,group::r-x,other::---,default:user::rw-,default:group::r-x,default:other::---",
  "group": "dummy000-0000-0000-00000000000",
  "owner": "$superuser",
  "permissions": "rwxr-x---+"
}

It looks like i can't set specific rights this way.看来我无法以这种方式设置特定权限。 I can't use the portal.我无法使用门户。 Is there a CLI command which i can use.是否有我可以使用的 CLI 命令。 The documentation is not very clear about this. 文档对此不是很清楚。

I read the linux documentation about ACL's and changed the command as follows:我阅读了有关 ACL 的 linux 文档并将命令更改如下:

#Get Object ID from the aplicationID:
$user = az ad sp show --id dummy000-0000-0000-00000000000 --query objectId 

# set default rights to the application and strip the quotes from the objectid
$set = "default:user:"+$user.Replace("`"","")+":rw-"

#set the default rights (child items and new as well):
az storage blob directory access set -a $set -d $dirname -c $filesystemName --account-name $storageaccountname

#check rights:
az storage blob directory access show -d $dirname  -c $filesystemName  --account-name $storageaccountname

You could use an ad emailadress as a user as well.您也可以将广告电子邮件地址用作用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 PDF 上传到 Azure 数据湖存储 Gen2 - Upload PDF to Azure Data Lake store Gen2 使用 Java 获取 Azure Data Lake Gen2 中的文件夹大小 - Obtain Folder size in Azure Data Lake Gen2 using Java Tableau + Azure Data Lake Gen2 多个文件或文件夹 - Tableau + Azure Data Lake Gen2 multiple files or folder 获取 Azure Data Lake Gen2 (ACL) 的特定用户权限 - Get specific user permissions on Azure Data Lake Gen2 (ACL) Azure 数据湖存储 Gen2 权限 - Azure Data Lake storage Gen2 permissions 我们能否使用Azure CLI将文件上传到Azure Data Lake Storage Gen2 - Can we use Azure CLI to upload files to Azure Data Lake Storage Gen2 Azure 的“Data Lake Storage Gen2”和“Data Lake Gen2”有什么区别? - What is the difference between Azure's "Data Lake Storage Gen2" and "Data Lake Gen2"? 如何借助“azure-storage”Package 在 Azure Data Lake Storage Gen2 中的容器内创建文件夹 - How to create a folder inside container in Azure Data Lake Storage Gen2 with the help of 'azure-storage' Package ML 组件在指向 Azure Data Lake Store Gen2 的 Azure Databricks (7.3.9) 中不起作用 - ML Components not working in Azure Databricks (7.3.9) pointing to Azure Data Lake Store Gen2 获取列表中数据湖 gen2 文件夹的所有内容 azure 突触工作区 - get all the contents of data lake gen2 folder in a list azure synapse workspace
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM