Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Audit for mandatory tags on resources should have excludeResourceTypes & excludeResourcegroupPattern #1939

Open
timmoh opened this issue Mar 4, 2025 · 0 comments

Comments

@timmoh
Copy link

timmoh commented Mar 4, 2025

The Policy Audit for mandatory tags on resources should have exclude ResourceTypes Parameter, because some Resources could not be tagged for example "microsoft.advisor/recommendations" which also apears in the list

In the same step we could also add ResourceGroupFilter

Parameter

"excludedResourceTypes": {
            "type": "Array",
            "metadata": {
                "displayName": "Excluded Resource Types",
                "description": "Exclude certain resource types from this policy, if all resourceTypes are selected by using an empty resourceTypeList",
                "strongType": "ResourceType"
            },
            "defaultValue": []
            },
        "excludedResourceGroupPatterns": {
            "type": "Array",
            "metadata": {
                "displayName": "Excluded Resource Groups; wild card patterns are supported. Example: 'rg-*, rg-abc-*'",
                "description": "This array contains all excluded RGs from this policy"
            },
            "defaultValue": []
        }

add to if-condition

{
      "field": "type",
      "notIn": "[parameters('excludedResourceTypes')]"
  },
"count": {
      "value": "[parameters('excludedResourceGroupPatterns')]",
      "name": "excludedRG",
      "where": {
          "value": "[resourceGroup().name]",
          "like": "[current('excludedRG')]"
      }
  },
  "equals": 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant