azure - 如何在adls2中找到容器的 super 用户

标签 azure azure-storage azure-blob-storage azure-data-lake

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

如何找到该容器的 super 用户?我尝试获取属性API但仍然看到响应为 $superuser

最佳答案

您可以使用Az powershell 命令获取 $superuser(Owner),它返回 Owner对象 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

enter image description here

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

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

enter image description here

更新:

是的,您可以使用 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>'

enter image description here

它还会返回 $superuser(Owner)对象 ID,但在 azure cli 中,没有内置命令可以通过 对象ID,您可以通过 az ad user show 获取该对象的详细信息, az ad sp show , az ad group show ,你需要事先知道对象的类型。

如果你不知道对象的类型,你可以直接使用 az rest调用Microsoft Graph获取详细信息。

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

enter image description here

关于azure - 如何在adls2中找到容器的 super 用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61566843/

相关文章:

Azure Frontdoor Classic 规则引擎配置为 Premium

java - Azure 存储服务 REST API : Create Lease

c# - 将文件上传到 Azure 存储会导致错误 : Timeouts are not supported on this stream

azure - 将 azure blob 存储链接到计算机

azure - 从 Windows Azure Blob 存储播放音频文件时出错

Azure SQL Azure AD 身份验证失败

sql-server - 如何使用 Azure SQL 数据库防止/处理 ErrBadConn

c# - 无法下载 Azure Blob 进行流式传输

java - azure-storage-api java 的 downloadAttributes 上不存在指定的 blob

azure - 从多个 blob 文件夹中删除 *(所有文件)