Because the related resource type (lock) within your ARM template can be deployed to multiple scopes, and you are assigning the policy at the management group level, I recommend adding the "scope" property to your ARM template in the policy? e.g.
"scope": "[subscription().id]"
Here's what it looks like within a sample ARM template:
{
"type": "Microsoft.Authorization/locks",
"apiVersion": "2020-05-01",
"name": "string",
"scope": "string",
"properties": {
"notes": "string",
"owners": [
{
"applicationId": "string"
}
]
}
}
This should hopefully at least fix the remediation failure assuming the policy assignment managed identity has the required permissions to deploy resource locks to the subscriptions within your management group.
Related links:
- https://learn.microsoft.com/en-us/azure/templates/microsoft.authorization/locks?pivots=deployment-language-arm-template
- https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deploy-to-subscription?tabs=azure-cli
Hope that helps,
Jesse