Azure Policy - Compare the Resourcegroup tag with the Ressources inside

Philipp Gerber 251 Reputation points
2022-04-21T12:55:39.723+00:00

Hello Community,

i need a Azure Policy to compare all Resource Groups Tags with the Inside Resources.

For Example:

The RessourceGroup have the Tag "Demo:Project"
The Ressources inside this Ressource Group have the "Demo:Stage" Tag.

Now I want to find all mismatched resources by tag.

So all those who have the tag name, but a different value.
in addition, however, only the resources that match the tag name should be displayed.

So the Ressource with an Tag "Hello:Welt" should not be considered.

Example:

RG = Demo:Project
Ressource1 = Demo:Project
Ressource2 = Demo: Project
Ressource 3= Demo:123
Ressource 4 = Hallo:Welt

Now i would like the follow result:
The Policy should show me only the Ressource 3 because the TagValue is different as the Tag Value from the RessourecGroup but the TagName is the same.

Thanks a lot.

'Best Regards,
Phil

Azure Policy
Azure Policy
An Azure service that is used to implement corporate governance and standards at scale for Azure resources.
788 questions
{count} votes