如何在 adls2 中找到容器的超级用户

How to find the superuser for a container in adls2

我有一个由某人创建的容器,我正在使用它加载数据。在管理访问选项卡中,我看到我的用户名以及设置了不同级别 ACL 的 $superuser(Owner) 和 $superuser(Owning Group)。

如何找到谁是该容器的超级用户?我尝试了 Get Properties API 但仍然看到 $superuser

的响应

您可以使用 Az powershell 命令获取 $superuser(Owner),它 returns OwnerObject ID,这可能是一个用户,组,Azure AD 中的服务主体。

Connect-AzAccount
$storageAccount = Get-AzStorageAccount -ResourceGroupName <group-name> -AccountName <storage-account-name>
$ctx = $storageAccount.Context
$filesystemName = "<container-name>"
$filesystem = Get-AzDataLakeGen2Item -Context $ctx -FileSystem $filesystemName
$filesystem.Owner

如果您想获取 Object ID 的详细信息,可以使用下面的 AzureAD 命令。

Connect-AzureAD
Get-AzureADObjectByObjectId -ObjectIds $filesystem.Owner

更新:

是的,您可以使用 azure cli 命令 az storage blob directory access show,首先您需要添加 storage-preview 扩展。

az extension add -n storage-preview
az login
az storage blob directory access show -d '/' -c '<container-name>' --account-name '<account-name>'

它也是returns Object ID$superuser(Owner),但是在azure cli中,没有内置命令来获取带有Object ID的目录对象,你可以通过az ad user show, az ad sp show, az ad group show获取对象的详细信息,你需要事先知道对象的类型。

如果您不知道对象的类型,您可以使用 az rest to call Microsoft Graph 获取详细信息。

az rest --method get --uri https://graph.microsoft.com/v1.0/directoryObjects/<Object ID>