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
If I run the first part of the query I get an id like this:
/subscriptions/xxxx/resourceGroups/aprl-sandbox-rg/providers/Microsoft.Compute/virtualMachineScaleSets/aprl-vmss1
If I then run the query inside the join I get an id like this:
/subscriptions/xxxx/resourcegroups/aprl-sandbox-rg/providers/Microsoft.Compute/virtualMachineScaleSets/aprl-vmss1
It is subtle but notice the 'G' in resourceGroups is capitalized in the first result but not the second. This causes the leftouter join to only take the left results and not do the join as expected and leaving autoscale settings to be null.
To Reproduce
Steps to reproduce the behaviour:
Create a VMSS with autoscale settings and predictive disabled
Expected behaviour
Should catch if autoscale is turned on but predictive is disabled.
Screenshots 📷
If applicable, add screenshots to help explain your problem. Please feel free to blur/cover any sensitive information.
Additional context
Suggest changing the query to the following:
// Find VMSS instances associated with autoscale settings when predictiveAutoscalePolicy_scaleMode is disabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where iff(isempty(tostring(tags['aks-managed-poolName'])), true, false)
| project name, id=tolower(id), tags
| join kind=leftouter (
resources
| where type == "microsoft.insights/autoscalesettings"
| where tostring(properties.targetResourceUri) contains "Microsoft.Compute/virtualMachineScaleSets"
| project id = tolower(tostring(properties.targetResourceUri)), autoscalesettings = properties
) on id
| where autoscalesettings.enabled == "true" and autoscalesettings.predictiveAutoscalePolicy.scaleMode == "Disabled"
| project recommendationId = "3f85a51c-e286-9f44-b4dc-51d00768696c", name, id, tags, param1 = "predictiveAutoscalePolicy_scaleMode: Disabled"
| order by id asc
The text was updated successfully, but these errors were encountered:
Describe the bug
The ARG for Enable Predictive autoscale and configure at least for Forecast Only
does not change id's to all lower case before joining leading to autoscalesettings set to null after join.
If I run the first part of the query I get an id like this:
/subscriptions/xxxx/resourceGroups/aprl-sandbox-rg/providers/Microsoft.Compute/virtualMachineScaleSets/aprl-vmss1
If I then run the query inside the join I get an id like this:
/subscriptions/xxxx/resourcegroups/aprl-sandbox-rg/providers/Microsoft.Compute/virtualMachineScaleSets/aprl-vmss1
It is subtle but notice the 'G' in resourceGroups is capitalized in the first result but not the second. This causes the leftouter join to only take the left results and not do the join as expected and leaving autoscale settings to be null.
To Reproduce
Steps to reproduce the behaviour:
Create a VMSS with autoscale settings and predictive disabled
Expected behaviour
Should catch if autoscale is turned on but predictive is disabled.
Screenshots 📷
If applicable, add screenshots to help explain your problem. Please feel free to blur/cover any sensitive information.
Additional context
Suggest changing the query to the following:
// Find VMSS instances associated with autoscale settings when predictiveAutoscalePolicy_scaleMode is disabled
resources
| where type == "microsoft.compute/virtualmachinescalesets"
| where iff(isempty(tostring(tags['aks-managed-poolName'])), true, false)
| project name, id=tolower(id), tags
| join kind=leftouter (
resources
| where type == "microsoft.insights/autoscalesettings"
| where tostring(properties.targetResourceUri) contains "Microsoft.Compute/virtualMachineScaleSets"
| project id = tolower(tostring(properties.targetResourceUri)), autoscalesettings = properties
) on id
| where autoscalesettings.enabled == "true" and autoscalesettings.predictiveAutoscalePolicy.scaleMode == "Disabled"
| project recommendationId = "3f85a51c-e286-9f44-b4dc-51d00768696c", name, id, tags, param1 = "predictiveAutoscalePolicy_scaleMode: Disabled"
| order by id asc
The text was updated successfully, but these errors were encountered: