Skip to content

Commit

Permalink
feat: Added filter to applicable VMSS ARG queries to filter out AKS m…
Browse files Browse the repository at this point in the history
…anaged VMSSs (#564)

Co-authored-by: Eric Henry <[email protected]>
  • Loading branch information
judyer28 and ejhenry authored Dec 13, 2024
1 parent 771fd5e commit 82540d4
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Find VMSS instances with one or no Zones selected
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| where location in~ ("australiaeast", "brazilsouth", "canadacentral", "centralindia", "centralus", "eastasia", "eastus", "eastus2", "francecentral", "germanywestcentral", "israelcentral", "italynorth", "japaneast", "japanwest", "koreacentral", "mexicocentral", "newzealandnorth", "northeurope", "norwayeast", "polandcentral", "qatarcentral", "southafricanorth", "southcentralus", "southeastasia", "spaincentral", "swedencentral", "switzerlandnorth", "uaenorth", "uksouth", "westeurope", "westus2", "westus3", "usgovvirginia", "chinanorth3")
| where array_length(zones) <= 1 or isnull(zones)
| project recommendationId = "1422c567-782c-7148-ac7c-5fc14cf45adc", name, id, tags, param1 = "AvailabilityZones: Single Zone"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Find VMSS instances associated with autoscale settings when predictiveAutoscalePolicy_scaleMode is disabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| project name, id, tags
| join kind=leftouter (
resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Find all VMs that do NOT have automatic repair policy enabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| where properties.automaticRepairsPolicy.enabled == false
| project recommendationId = "820f4743-1f94-e946-ae0b-45efafd87962", name, id, tags, param1 = "automaticRepairsPolicy: Disabled"

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
// Find all VMs that do NOT have health monitoring enabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| join kind=leftouter (
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| mv-expand extension=properties.virtualMachineProfile.extensionProfile.extensions
| where extension.properties.type in ( "ApplicationHealthWindows", "ApplicationHealthLinux" )
| project id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Find all zonal VMs that are NOT deployed with Flex orchestration mode
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| where properties.orchestrationMode != "Flexible"
| project recommendationId = "e7495e1c-0c75-0946-b266-b429b5c7f3bf", name, id, tags, param1 = strcat("orchestrationMode: ", tostring(properties.orchestrationMode))

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Find VMSS instances associated with autoscale settings when autoscale is disabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where isempty(tostring(tags['aks-managed-poolName']))
| project name, id, tags
| join kind=leftouter (
resources
Expand Down

0 comments on commit 82540d4

Please sign in to comment.