用于更新安全原则的 az cli 命令不起作用

az cli command for the updating the security principle is not working

非常奇怪,Microsoft 文档没有明确说明在不修改任何现有 ACL 条目的情况下在现有 blob 现有目录中创建新 ACL 条目的步骤。 我的目的是根据需要及时创建新的安全主体,有时还需要更新现有安全主体的权限。

没理解,如何实现文档中提到的以下几点。 https://docs.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-acl-cli#:~:text=To%20update%20an%20ACL%2C%20create%20a%20new%20ACL%20object%20with%20the%20ACL%20entry%20that%20you%20want%20to%20update%2C%20and%20then%20use%20that%20object%20in%20update%20ACL%20operation.%20Do%20not%20get%20the%20existing%20ACL%2C%20just%20provide%20ACL%20entries%20to%20be%20updated.

"要更新 ACL,请使用要更新的 ACL 条目创建一个新的 ACL 对象,然后在更新 ACL 操作中使用该对象。不要获取现有的 ACL,只需提供要更新的 ACL 条目."

下面是我试过的

az storage fs access set --permissions "user:objctidxxxxxxxxxx:rwx" -p /testdata01blob01directory01/testdatablob01directory01sub01 -f  testdatablob01 --account-name testdata0

我遇到以下错误,尝试了不同的语法但没有成功

(InvalidPermission) The permission value is invalid.
RequestId:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

"To update an ACL, create a new ACL object with the ACL entry that you want to update, and then use that object in update ACL operation. Do not get the existing ACL, just provide ACL entries to be updated."

上面的段落描述了如果您想更改 acl 的权限,建议创建一个具有所需权限的新 acl,而不是使用现有的 acl 权限并更新它。

My aim here is to create new Security principal on timely requirement you should have to use update acl inorder to create a new service principal & add the permissions to it .

根据文档,如果您想更改安全主体的权限级别或向 ACL 添加新的安全主体而不影响其他现有条目,您应该 更新取而代之的是 ACL。

az storage fs access set --permissions "user:objctidxxxxxxxxxx:rwx" -p /testdata01blob01directory01/testdatablob01directory01sub01 -f testdatablob01 --account-name testdata0

(InvalidPermission) The permission value is invalid. RequestId:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

如果要更新特定目录下特定 blob 的 acl 权限,则需要在上述 cmdlet 中使用 --acl 标志而不是 --persmission

  • 如果您使用授权模式作为密钥,则需要在您的 cmdlet 中传递存储帐户密钥。
 az storage fs access set --acl "user:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:rwx" -p <directorypath>  -f <filesystemname> --account-name <datalakestorageaccount> --auth-mode key --account-key <storage-account-key>

这里是示例输出以供参考:

  • 如果您使用授权模式登录,如文档中所述,您需要具有 storage blob data owner 角色
  az storage fs access set --acl "user:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx:rwx" -p <directorypath>  -f <filesystemname> --account-name <datalakestorageaccount> --auth-mode login

这里是示例输出以供参考:

您可以参考此文档了解更多 sample examplesaz storage fs access set cmdlet 的用法。