Last active
May 6, 2022 18:25
-
-
Save tyconsulting/14137eb880edf4397918a91f924b3b01 to your computer and use it in GitHub Desktop.
Append Hybrid Use Benefit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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