Hello! :)
I am fairly new to Azure Policy, I am trying to create a policy to target windows servers that doesn't have AHUB enabled, however this policy keeps getting Linux machines in aswell.
Why is that, when I state it should be windowsserver or dynamics?
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"anyOf": [
{
"field": "type",
"equals": "Microsoft.Compute/virtualMachines"
}
]
},
{
"anyOf": [
{
"field": "Microsoft.Compute/virtualMachines/storageProfile.imageReference.publisher",
"equals": "MicrosoftDynamicsAX"
},
{
"field": "Microsoft.Compute/virtualMachines/storageProfile.imageReference.publisher",
"equals": "MicrosoftWindowsServer"
}
]
},
{
"field": "Microsoft.Compute/virtualMachines/licenseType",
"notEquals": "Windows_Server"
}
]
},
"then": {
"effect": "audit"
}
},
"parameters": {}
}