假设我正在使用二头肌文件来部署应用服务:
param tags object
param name string
param location string = resourceGroup().location
param skuName string = 'F1'
resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
name: name
location: location
properties:{
}
tags: tags
sku: {
name: skuName
}
kind:'windows'
}
output resourceId string = appServicePlan.id
字符串
我想报告资源组中的所有资源,对于应用程序服务计划资源(microsoft.web/serverfarms),我想报告操作系统。
所以我有一个powershell命令,看起来像这样:
Search-AzGraph -query "where resourceGroup in ($resourceGroupFilter) | project name, type, kind, location, resourceGroup, sku, OS = tostring(properties.kind) | order by name asc"
型
由于kind的值始终为'functionApp',因此它不是'Windows'或'Linux'。如果资源类型为应用服务计划,如何将查询更改为在操作系统上报告?
1条答案
按热度按时间xriantvc1#
您需要关注
reserved
属性,而不是使用kind
属性。此属性确定您的应用服务计划运行在哪个操作系统上。x1c 0d1x的数据
有关应用程序服务计划,请参阅arm模板模式中的此AppServicePlan属性部分。
以下是在订阅下拉取Linux应用服务计划的示例查询:
的
备注:保留属性位于应用服务计划的属性下。如果要对其应用筛选器。在AzGraph查询中,您需要使用
properties.reserved == "true"
应用示例中所示的筛选器