You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: includes/resource-graph/samples/bytable/healthresourcechanges.md
+74-2Lines changed: 74 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,53 @@ ms.author: timwarner
7
7
ms.custom: generated
8
8
---
9
9
10
-
### Query title
10
+
### Azure VMs impacted by Azure-initiated maintenance
11
11
12
-
Query description.
12
+
Returns a list of virtual machines (VMs) impacted by routine Azure-initiated maintenance operations in the past 14 days, along with the corresponding reason for impact.
13
13
14
14
```kusto
15
+
HealthResourceChanges
16
+
| where properties.targetResourceType =~ 'microsoft.resourcehealth/resourceannotations'
17
+
| where properties['changes']['properties.category']['newValue'] =~ 'Planned'
18
+
| project Id = tostring(split(tolower(properties.targetResourceId), '/providers/microsoft.resourcehealth/resourceannotations')[0]), Reason = properties['changes']['properties.reason']['newValue']
19
+
```
20
+
21
+
# [Azure CLI](#tab/azure-cli)
22
+
23
+
```azurecli-interactive
24
+
az graph query -q ""
25
+
```
26
+
27
+
# [Azure PowerShell](#tab/azure-powershell)
28
+
29
+
```azurepowershell-interactive
30
+
Search-AzGraph -Query ""
31
+
```
32
+
33
+
# [Portal](#tab/azure-portal)
34
+
35
+
:::image type="icon" source="../../../../articles/governance/resource-graph/media/resource-graph-small.png"::: Try this query in Azure Resource Graph Explorer:
- Azure Government portal: <ahref="https://portal.azure.us/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ "target="_blank">portal.Azure.us</a>
39
+
- Azure China 21Vianet portal: <ahref="https://portal.azure.cn/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ "target="_blank">portal.Azure.cn</a>
40
+
41
+
---
15
42
43
+
### Changes to health annotations over past 14 days
44
+
45
+
Returns a list of all changes to health annotations in the past 14 days. Nulls indicate there was no update to that specific field, corresponding to a change in the `Annotation Name` field)
46
+
47
+
```kusto
48
+
healthresourcechanges
49
+
| where type == "microsoft.resources/changes"
50
+
| where properties.targetResourceType =~ "microsoft.resourcehealth/resourceannotations"
51
+
| extend Id = tolower(split(properties.targetResourceId, '/providers/Microsoft.ResourceHealth/resourceAnnotations/current')[0]),
0 commit comments