Skip to content

Commit 5464939

Browse files
Incremental update
1 parent 05ca036 commit 5464939

File tree

1 file changed

+74
-2
lines changed

1 file changed

+74
-2
lines changed

includes/resource-graph/samples/bytable/healthresourcechanges.md

Lines changed: 74 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,53 @@ ms.author: timwarner
77
ms.custom: generated
88
---
99

10-
### Query title
10+
### Azure VMs impacted by Azure-initiated maintenance
1111

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.
1313

1414
```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:
36+
37+
- Azure portal: <a href="https://portal.azure.com/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ " target="_blank">portal.Azure.com</a>
38+
- Azure Government portal: <a href="https://portal.azure.us/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ " target="_blank">portal.Azure.us</a>
39+
- Azure China 21Vianet portal: <a href="https://portal.azure.cn/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ " target="_blank">portal.Azure.cn</a>
40+
41+
---
1542

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]),
52+
Timestamp = todatetime(properties.changeAttributes.timestamp), AnnotationName = properties['changes']['properties.annotationName']['newValue'], Reason = properties['changes']['properties.reason']['newValue'],
53+
Context = properties['changes']['properties.context']['newValue'], Category = properties['changes']['properties.category']['newValue']
54+
| where isnotempty(AnnotationName)
55+
| project Timestamp, Id, PreviousAnnotation = properties['changes']['properties.annotationName']['previousValue'], AnnotationName, Reason, Context, Category
56+
| order by Timestamp desc
1657
```
1758

1859
# [Azure CLI](#tab/azure-cli)
@@ -37,10 +78,41 @@ Search-AzGraph -Query ""
3778

3879
---
3980

81+
### VM availability state changes over past 14 days
4082

83+
Returns a list of all changes to VM availability states in the past 14 days.
4184

85+
```kusto
86+
healthresourcechanges
87+
| where type == "microsoft.resources/changes"
88+
| where properties.targetResourceType =~ "microsoft.resourcehealth/availabilityStatuses"
89+
| extend Id = tolower(split(properties.targetResourceId, '/providers/Microsoft.ResourceHealth/availabilityStatuses/current')[0]),
90+
Timestamp = todatetime(properties.changeAttributes.timestamp), PreviousAvailabilityState = properties['changes']['properties.availabilityState']['previousValue'],
91+
LatestAvailabilityState = properties['changes']['properties.availabilityState']['newValue']
92+
| where isnotempty(LatestAvailabilityState)
93+
| project Timestamp, Id, PreviousAvailabilityState, LatestAvailabilityState
94+
| order by Timestamp desc
95+
```
4296

97+
# [Azure CLI](#tab/azure-cli)
4398

99+
```azurecli-interactive
100+
az graph query -q ""
101+
```
44102

103+
# [Azure PowerShell](#tab/azure-powershell)
45104

105+
```azurepowershell-interactive
106+
Search-AzGraph -Query ""
107+
```
108+
109+
# [Portal](#tab/azure-portal)
110+
111+
:::image type="icon" source="../../../../articles/governance/resource-graph/media/resource-graph-small.png"::: Try this query in Azure Resource Graph Explorer:
112+
113+
- Azure portal: <a href="https://portal.azure.com/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ " target="_blank">portal.Azure.com</a>
114+
- Azure Government portal: <a href="https://portal.azure.us/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ " target="_blank">portal.Azure.us</a>
115+
- Azure China 21Vianet portal: <a href="https://portal.azure.cn/?feature.customportal=false#blade/HubsExtension/ArgQueryBlade/query/ " target="_blank">portal.Azure.cn</a>
116+
117+
---
46118

0 commit comments

Comments
 (0)