【发布时间】:2022-11-11 07:15:04
【问题描述】:
我有这个 Azure Graph 查询来获取我所有的存储帐户:
resources
| where type == 'microsoft.storage/storageaccounts'
| join kind=inner (
resourcecontainers
| where type == 'microsoft.resources/subscriptions'
| project subscriptionId, subscriptionName = name)
on subscriptionId
| project name,sku,properties,tags,resourceGroup,tenantId,subscriptionId,location,subscriptionName
现在我需要为每个存储帐户获取容器名称和每个容器的“公共访问级别”,就像 Azure 门户中的这张图片一样:
我在 Azure Graph 中找不到正确的查询来执行此操作。有什么帮助吗?
【问题讨论】:
-
@alferdoFernandez,据我了解,您无法使用资源图资源管理器查询在存储帐户中拉取容器列表及其访问级别以下是可以使用图资源管理器查询拉取的属性列表,如图所示。 i.imgur.com/YKoQZUb.png
-
@VenkateshDodda-MSFT 好的,那么您的意思是这是 Azure Graph 中的一个限制,其中容器不是数据模型的一部分,对吧?
-
@Alferdo Fernandez - 是的,您不能使用资源图资源管理器在存储帐户中提取容器列表。您可能必须使用任何 powershell 脚本来实现这一点。