Bylaw

Gallery › General › Azure Community Policy

Use match condition on tag value.

Doesn't convert yet Policy Audit Deny Disabled Mode All Version 1.0.0

Enforce a text pattern on tag value.

ConvertTo-Bylaw can't convert this policy yet:

Azure Policy JSONazurepolicy.json · 39 lines
{
  "name": "c16955f5-8268-4875-9354-c8d81247ffe4",
  "type": "Microsoft.Authorization/policyDefinitions",
  "properties": {
    "displayName": "Use match condition on tag value.",
    "description": "Enforce a text pattern on tag value.",
    "metadata": {
      "version": "1.0.0",
      "category": "General"
    },
    "mode": "All",
    "parameters": {
      "effect": {
        "type": "String",
        "metadata": {
          "displayName": "Effect",
          "description": "Deny, Audit or Disabled the execution of the Policy"
        },
        "allowedValues": [
          "Deny",
          "Audit",
          "Disabled"
        ],
        "defaultValue": "Audit"
      }
    },
    "policyRule": {
      "if": {
        "not": {
          "field": "tags.date",
          "match": "##-???-####"
        }
      },
      "then": {
        "effect": "[parameters('effect')]"
      }
    }
  }
}

Source: policyDefinitions/General/use-match-condition-on-tag-value/azurepolicy.json in Azure/Community-Policy, under the MIT licence.