Hi,
It might be best to change the policy to have the following condition as well:
{
"field": "Microsoft.Compute/virtualMachines/extensions/provisioningState",
"in": [
"Succeeded",
"Provisioning succeeded"
]
}
This will make sure that the agent is at least provisioned successfully when reported to the policy. Of course there could be still other problems with the agent but provisioning will not be one of them.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.