Skip to content

Commit 5cd52a7

Browse files
authored
Merge pull request #192170 from timwarner-msft/timwarner-03182022-2
Add new category (Azure Spot) and KQL sample queries
2 parents 7819a41 + eede29a commit 5cd52a7

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

articles/governance/resource-graph/samples/samples-by-category.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ Otherwise, use <kbd>Ctrl</kbd>-<kbd>F</kbd> to use your browser's search feature
5555

5656
[!INCLUDE [azure-resource-graph-samples-cat-azure-service-health](../../../../includes/resource-graph/samples/bycat/azure-service-health.md)]
5757

58+
## Azure Spot
59+
60+
[!INCLUDE [azure-resource-graph-samples-cat-azure-spot](../../../../includes/resource-graph/samples/bycat/azure-spot.md)]
61+
5862
## Azure SQL
5963

6064
[!INCLUDE [azure-resource-graph-samples-cat-azure-sql](../../../../includes/resource-graph/samples/bycat/azure-sql.md)]
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
author: timwarner-msft
3+
ms.service: resource-graph
4+
ms.topic: include
5+
ms.date: 03/18/2022
6+
ms.author: timwarner
7+
ms.custom: generated
8+
---
9+
10+
### Compare the Spot eviction rate across multiple VM SKUs and regions
11+
12+
This query gets the Spot eviction rate across multiple VM SKUs and regions. Spot eviction rate is presented as a percentage range. The results are sorted by VM SKU and region in ascending order.
13+
14+
```kusto
15+
SpotResources
16+
| where type =~ 'microsoft.compute/skuspotevictionrate/location'
17+
| where sku.name in~ ('standard_d2s_v4', 'standard_d4s_v4')
18+
| where location in~ ('eastus', 'southcentralus')
19+
| project skuName = tostring(sku.name), location, spotEvictionRate = tostring(properties.evictionRate)
20+
| order by skuName asc, location asc
21+
```
22+
23+
### Compare the latest Spot price across multiple VM SKUs and regions for an OS type
24+
25+
This query gets the latest Spot price across multiple VM SKUs and regions for an OS type. The results are sorted by price in ascending order.
26+
27+
```kusto
28+
SpotResources
29+
| where type =~ 'microsoft.compute/skuspotpricehistory/ostype/location'
30+
| where sku.name in~ ('standard_d2s_v4', 'standard_d4s_v4')
31+
| where properties.osType =~ 'linux'
32+
| where location in~ ('eastus', 'southcentralus')
33+
| project skuName = tostring(sku.name), osType = tostring(properties.osType), location, latestSpotPriceUSD = todouble(properties.spotPrices[0].priceUSD)
34+
| order by latestSpotPriceUSD asc
35+
```
36+
37+
---

0 commit comments

Comments
 (0)