Azure / azure-policy

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

Alias Request: Microsoft.OperationalInsights/workspaces/retentionInDays #1002

Open rajakesar opened 2 years ago

rajakesar commented 2 years ago
Error Message

"The policy definition 'modify_logAnalytics_retentionDays' has operations referring to aliases that are not modifiable: 'Microsoft.OperationalInsights/workspaces/retentionInDays'.

Policy

"policyRule": { "if": { "allOf": [ { "field": "type", "equals": "Microsoft.OperationalInsights/workspaces" }, { "anyOf": [ { "field": "Microsoft.OperationalInsights/workspaces/retentionInDays", "notEquals": "[parameters('retentionInDays')]" } ] } ] }, "then": { "effect": "[parameters('effect')]", "details": { "roleDefinitionIds": [ "/providers/microsoft.authorization/roleDefinitions/92aaf0da-9dab-42b6-94a3-d43ce8d16293" ], "conflictEffect": "Audit", "operations": [ { "operation": "addOrReplace", "field": "Microsoft.OperationalInsights/workspaces/retentionInDays", "value": "[parameters('retentionInDays')]" } ] } } }

nehakulkarni123 commented 2 years ago

Hi @rajakesar, aliases go through additional requirements to become modifiable-- therefore modifiable aliases are a subset of aliases today. I'll share your request with our team to see if this particular alias meets the correct requirements.