Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Append Hybrid Use Benefit
{
"type": "Microsoft.Authorization/policyDefinitions",
"name": "append-hybrid-use-benefit",
"properties": {
"displayName": "Append hybrid use benefit",
"description": "This policy will automatically configure hybrid use benefit for Windows Servers.",
"parameters": {},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"in": [
"Microsoft.Compute/virtualMachines",
"Microsoft.Compute/VirtualMachineScaleSets"
]
},
{
"field": "Microsoft.Compute/imagePublisher",
"equals": "MicrosoftWindowsServer"
},
{
"field": "Microsoft.Compute/imageOffer",
"equals": "WindowsServer"
},
{
"field": "Microsoft.Compute/imageSKU",
"in": [
"2008-R2-SP1",
"2008-R2-SP1-smalldisk",
"2012-Datacenter",
"2012-Datacenter-smalldisk",
"2012-R2-Datacenter",
"2012-R2-Datacenter-smalldisk",
"2016-Datacenter",
"2016-Datacenter-Server-Core",
"2016-Datacenter-Server-Core-smalldisk",
"2016-Datacenter-smalldisk",
"2016-Datacenter-with-Containers",
"2016-Datacenter-with-RDSH"
]
},
{
"field": "Microsoft.Compute/licenseType",
"notEquals": "Windows_Server"
}
]
},
"then": {
"effect": "append",
"details": [
{
"field": "Microsoft.Compute/licenseType",
"value": "Windows_Server"
}
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.