Skip to content

Commit 1034d98

Browse files
Merge pull request #107820 from scautomation/patch-5
Update Non compliance example
2 parents ea192fe + 6c9520c commit 1034d98

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

includes/resource-graph/samples/bycat/azure-policy.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,16 @@ Search-AzGraph -Query "PolicyResources | where type =~ 'Microsoft.PolicyInsights
123123
Provides a list of all resources types that are in a `NonCompliant` state.
124124

125125
```kusto
126-
PolicyResources
126+
"PolicyResources
127127
| where type == 'microsoft.policyinsights/policystates'
128128
| where properties.complianceState == 'NonCompliant'
129+
| extend NonCompliantResourceId = properties.resourceId, PolicyAssignmentName = properties.policyAssignmentName"
129130
```
130131

131132
# [Azure CLI](#tab/azure-cli)
132133

133134
```azurecli-interactive
134-
az graph query -q "PolicyResources | where type == 'microsoft.policyinsights/policystates' | where properties.complianceState == 'NonCompliant'"
135+
az graph query -q "PolicyResources | where type == 'microsoft.policyinsights/policystates' | where properties.complianceState == 'NonCompliant' | extend NonCompliantResourceId = properties.resourceId, PolicyAssignmentName = properties.policyAssignmentName"
135136
```
136137

137138
# [Azure PowerShell](#tab/azure-powershell)

0 commit comments

Comments
 (0)