Wedel - Required resource tags¶
Audits or denies resources that do not contain all mandatory Wedel ALZ tags.
- Identyfikator:
governance-required-tags - Tryb:
Indexed - Typ zasobu:
Wiele typów / wg reguły - Domyślny efekt:
Audit
Dodatkowy opis¶
Polityka sprawdza istnienie każdego tagu z parametru requiredTagNames. Domyślnie są to Application, Owner, BusinessOwner, CostCenter, Environment, DataClassification, Criticality i Ticket. Nie sprawdza poprawności ani niepustej wartości tagu. Tryb Indexed nie obejmuje samych Resource Group. Audit raportuje brak tagu, Deny może zablokować utworzenie lub aktualizację, a Disabled wyłącza ocenę.
Przykładowe scenariusze¶
- Zasób zawierający wszystkie osiem domyślnych tagów: zgodny z warunkiem obecności tagów.
- Zasób bez tagu CostCenter: niezgodny; Audit zgłosi brak, a Deny może zablokować żądanie.
- Zasób ma wszystkie wymagane tagi, ale jeden ma pustą wartość: sama ta reguła sprawdza istnienie, nie niepustą wartość.
Reguła¶
{
"if": {
"count": { "value": "[parameters('requiredTagNames')]", "name": "tagName", "where": { "field": "[concat('tags[', current('tagName'), ']')]", "exists": "false" } },
"greater": 0
},
"then": { "effect": "[parameters('effect')]" }
}
Parametry¶
{
"effect": {
"type": "String",
"metadata": { "displayName": "Effect" },
"allowedValues": ["Audit", "Deny", "Disabled"],
"defaultValue": "Audit"
},
"requiredTagNames": {
"type": "Array",
"metadata": { "displayName": "Required tags" },
"defaultValue": ["Application", "Owner", "BusinessOwner", "CostCenter", "Environment", "DataClassification", "Criticality", "Ticket"]
}
}