I'm trying to extract all APP service plan in a Azure subscription with az cli.
Command is az resource list, output below
[
{
"id": "/subscriptions/123453343434-83-342-3434-34-3/resourceGroups/KC-EMEA-RSGP-PROJECTS-PRD-01/providers/Microsoft.Web/serverFarms/EMEA-ASPLAN-PROJECTS-PRD-01",
"identity": null,
"kind": "app",
"location": "westeurope",
"managedBy": null,
"name": "EMEA-ASPLAN-PROJECTS-PRD-01",
"plan": null,
"properties": null,
"resourceGroup": "EMEA-RSGP-PROJECTS-PRD-01",
"sku": {
"capacity": 1,
"family": "Pv2",
"model": null,
"name": "P3v2",
"size": "P3v2",
"tier": "PremiumV2"
},
"tags": {
"CUSTOMER": "Customer",
"Creator": "matteo",
"SCOPE": "PRODUCTION"
},
"type": "Microsoft.Web/serverFarms"
},
{
"id": "/subscriptions/123453343434-83-342-3434-34-3/resourceGroups/DefaultResourceGroup-WEU/providers/Microsoft.OperationalInsights/workspaces/DefaultWorkspace-123453343434-83-342-3434-34-3",
"identity": null,
"kind": null,
"location": "westeurope",
"managedBy": null,
"name": "DefaultWorkspace-123453343434-83-342-3434-34-3",
"plan": null,
"properties": null,
"resourceGroup": "DefaultResourceGroup-WEU",
"sku": null,
"tags": null,
"type": "Microsoft.OperationalInsights/workspaces"
},
{
"id": "/subscriptions/123453343434-83-342-3434-34-3/resourceGroups/defaultresourcegroup-weu/providers/Microsoft.OperationsManagement/solutions/Security(DefaultWorkspace-123453343434-83-342-3434-34-3)",
"identity": null,
"kind": null,
"location": "westeurope",
"managedBy": null,
"name": "Security(DefaultWorkspace-123453343434-83-342-3434-34-3-WEU)",
"plan": {
"name": "Security(DefaultWorkspace-123453343434-83-342-3434-34-3-WEU)",
"product": "OMSGallery/Security",
"promotionCode": "",
"publisher": "Microsoft",
"version": null
},
"properties": null,
"resourceGroup": "defaultresourcegroup-weu",
"sku": null,
"tags": null,
"type": "Microsoft.OperationsManagement/solutions"
}
]
Now I'd like to extract only the type contains 'Microsoft.Web/serverFarms' with JMESPATH language. I'm using Azure Command line az resource list --query [].{type:type}
But I've multiple type. How can I get only type contains 'Microsoft.Web/serverFarms' ?
output of the query is
[
{
"type": "Microsoft.Web/serverFarms"
},
{
"type": "Microsoft.OperationalInsights/workspaces"
},
{
"type": "Microsoft.OperationsManagement/solutions"
}
]