With the possibility that this is a bug with the resource provider, to get an official response from the team you can log an issue here against their GitHub repo: https://github.com/Azure/azure-policy/issues
As you mention there is no existing built-in policy to deny or even deploy/modify a managed identity for this resource type so there could be an underlying limitation as you've discovered.
This builtin I found uses an AuditIfNotExists effect. https://www.azadvertizer.net/azpolicyadvertizer/2b9ad585-36bc-4615-b300-fd4435808332.html
{
"displayName": "App Service apps should use managed identity",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Use a managed identity for enhanced authentication security",
"metadata": { "version": "3.0.0", "category": "App Service" },
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": ["AuditIfNotExists", "Disabled"],
"defaultValue": "AuditIfNotExists"
}
},
"policyRule": {
"if": {
"allOf": [
{ "field": "type", "equals": "Microsoft.Web/sites" },
{ "field": "kind", "notContains": "functionapp" }
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Web/sites/config",
"name": "web",
"existenceCondition": {
"anyOf": [
{
"field": "Microsoft.Web/sites/config/managedServiceIdentityId",
"exists": "true"
},
{
"field": "Microsoft.Web/sites/config/xmanagedServiceIdentityId",
"exists": "true"
}
]
}
}
}
}
}
Similar story with this builtin, also uses AuditIfNotExists effect https://www.azadvertizer.net/azpolicyadvertizer/0da106f2-4ca3-48e8-bc85-c638fe6aea8f.html
{
"displayName": "Function apps should use managed identity",
"policyType": "BuiltIn",
"mode": "Indexed",
"description": "Use a managed identity for enhanced authentication security",
"metadata": { "version": "3.0.0", "category": "App Service" },
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": ["AuditIfNotExists", "Disabled"],
"defaultValue": "AuditIfNotExists"
}
},
"policyRule": {
"if": {
"allOf": [
{ "field": "type", "equals": "Microsoft.Web/sites" },
{ "field": "kind", "contains": "functionapp" },
{ "field": "kind", "notContains": "workflowapp" }
]
},
"then": {
"effect": "[parameters('effect')]",
"details": {
"type": "Microsoft.Web/sites/config",
"name": "web",
"existenceCondition": {
"anyOf": [
{
"field": "Microsoft.Web/sites/config/managedServiceIdentityId",
"exists": "true"
},
{
"field": "Microsoft.Web/sites/config/xmanagedServiceIdentityId",
"exists": "true"
}
]
}
}
}
}
}