Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
You used tags to exempt specific secrets, but Azure Policy still marked the tagged secrets as non-compliant.
Your attempt to create a custom policy using ARM mode didn't work because ARM mode only accesses control plane properties, while you need data plane properties.
Although you created exemptions with the REST API, compliance reports still marked those resources as non-compliant.
Microsoft confirmed that Azure Policy can't evaluate data plane properties for specific resources like individual secrets, so you can't enforce exemptions at that level.
The only workaround is to exempt the whole Key Vault, which doesn't give you the detailed control you need.
You can submit feedback through the Azure portal about needing these features. Microsoft reviews user feedback and may prioritize updates based on demand.
Keep an eye on Azure updates about Azure Policy and Key Vault, as Microsoft often releases new features.
https://azure.microsoft.com/en-us/updates/
Consider using other tools or solutions to manage secret lifecycles and enforce policies, as Azure Policy has some limitations.
For reference, please review this documentation: -
https://learn.microsoft.com/en-us/azure/governance/policy/concepts/exemption-structure
https://learn.microsoft.com/en-us/azure/governance/policy/samples/built-in-policies
https://learn.microsoft.com/en-us/azure/defender-for-cloud/policy-reference?WT.mc_id=itopstalk-blog-socuff
https://learn.microsoft.com/en-us/azure/key-vault/general/azure-policy?tabs=certificates
If you have any further queries, do let us know.
If the answer is helpful, please click "Accept Answer" and "Upvote it".