Azure / azure-policy

Repository for Azure Resource Policy built-in definitions and samples
MIT License
1.51k stars 1.09k forks source link

Unable to get deny effect using azure policy on sql db creation when azure hybrid benefit is not enabled #931

Open adapaharsha opened 2 years ago

adapaharsha commented 2 years ago

Hi, I tried below policy to deny sql db creation when azure hybrid is not enabled whereas audit effect is working fine. Deny effect still allows me to create but it shows under non-compliant post creation. Any help on this?

{ "mode": "All", "policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.Sql/servers/databases" }, { "field": "kind", "contains": "vcore" }, { "field": "Microsoft.Sql/servers/databases/licenseType", "notEquals": "BasePrice" } ] }, "then": { "effect": "deny" } }

adapaharsha commented 2 years ago

Any Thoughts??