Json 如何在Azure策略中实施标记值模式?
我希望对资源组所需的标记强制使用标记值模式“RJGVM-####”。 我设法使它成为必需的,但无论何时我输入任何值,它都会通过Json 如何在Azure策略中实施标记值模式?,json,azure,arm-template,azure-policy,policies,Json,Azure,Arm Template,Azure Policy,Policies,我希望对资源组所需的标记强制使用标记值模式“RJGVM-####”。 我设法使它成为必需的,但无论何时我输入任何值,它都会通过 { "mode": "All", "policyRule": { "if": { "allOf": [ { "field": "type", &qu
{
"mode": "All",
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.Resources/subscriptions/resourceGroups"
},
{
"not": {
"field": "[concat('tags[',parameters('tagName'), ']')]",
"exists": "true"
}
},
{
"value": "[resourceGroup().tags[parameters('tagName')]]",
"notMatch": "RJGVM-###"
}
]
},
"then": {
"effect": "deny"
}
},
"parameters": {
"tagName": {
"type": "String",
"metadata": {
"displayName": "Tag Name",
"description": "Name of the tag, such as 'environment'"
}
}
}
}
请参考以下链接中提到的示例,以确保标记值上的模式匹配: