It appears that you're correctly applying a policy definition, but it's not working as intended with the Azure Batch Pools, as it's denying creation even when the required tag is present. This could stem from the way Azure Batch handles resource tags compared to traditional resource-level tags recognized by Azure Policy.
Azure Batch Pools indeed have resource tags, which operate differently and may not be compatible with the standard Azure Policy checks you’re attempting. In Azure Policy, typically, you check against resource-level tags rather than these specific Batch resource tags.
The error you're encountering with your JSON policy rules for checking Microsoft.Batch/batchAccounts/pools/resourceTags.required_tag
likely arises because Azure Policy doesn’t allow for such granular checks on resource tags. Instead, it’s usually aimed at resource-level tags.
There's currently no direct way to enforce a policy on Azure Batch Pools for their specific resource tags using Azure Policy. Instead, you might consider using automated scripts (like Azure Functions or Azure Logic Apps) to periodically validate resources and ensure that they have the required tags, applying them if necessary.
https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/tag-support
If you found information helpful, please click "Upvote" on the post to let us know.
If you have any further queries feel free to reach out us we are happy to assist you.
Thank You.