Skip to content

Instantly share code, notes, and snippets.

@matt-FFFFFF
Created February 25, 2021 15:31
Show Gist options
  • Save matt-FFFFFF/3e64814526108f1fa6f06844530c07bd to your computer and use it in GitHub Desktop.
Save matt-FFFFFF/3e64814526108f1fa6f06844530c07bd to your computer and use it in GitHub Desktop.
Azure policy to disallow specific LA solutions
{
"properties": {
"displayName": "Disallowed Log Analytics solutions",
"policyType": "Custom",
"mode": "All",
"description": "This policy enables you to specify the resource types that your organization cannot deploy.",
"metadata": {
"category": "General",
},
"parameters": {
"solutionName": {
"type": "String",
"metadata": {
"displayName": "Log Analytics solution name to restrict, not including GUID suffix",
"description": "Log Analytics solution name to restrict, not including GUID suffix"
},
"defaultValue": "Security"
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.OperationsManagement/solutions"
},
{
"field": "name",
"like": "[concat(parameters('solutionName'),'(*)')]"
}
]
},
"then": {
"effect": "Deny"
}
}
},
"id": "/providers/Microsoft.Management/managementGroups/crs/providers/Microsoft.Authorization/policyDefinitions/6f6bc54d-fa13-4f79-a30f-d35954a6e045",
"type": "Microsoft.Authorization/policyDefinitions",
"name": "6f6bc54d-fa13-4f79-a30f-d35954a6e045"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment