Home » Microsoft » AZ-400 v.2 » HOTSPOT
HOTSPOT
Your company has an Azure subscription.
The company requires that all resource group in the subscription have a tag named organization set to a value of Contoso.
You need to implement a policy to meet the tagging requirement.
How should you complete the policy? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.
Hot Area:
Correct Answer:
Explanation/Reference:
Explanation:
Box 1: ” Microsoft.Resources/subscriptions/resourceGroups”
Box 2: “Deny”,
Sample – Enforce tag and its value on resource groups
},
“policyRule”: {
“if”: {
“allOf”: [
{
“field”: “type”,
“equals”: “Microsoft.Resources/subscriptions/resourceGroups”
},
{
“not”: {
“field”: “[concat(‘tags[‘,parameters(‘tagName’), ‘]’)]”,
“equals”: “[parameters(‘tagValue’)]”
}
}
]
},
“then”: {
“effect”: “deny”
}
}
}
}
https://docs.microsoft.com/en-us/azure/governance/policy/samples/enforce-tag-on-resource-groups
“The company requires that all resource groups in the subscription have a tag named organization set to a value of Contoso.” – This means also the existing resource groups need to have a tag.
For that reason:
1. Microsoft.Resources/subscriptions/resourceGroups
2. Append
based on doc: https://docs.microsoft.com/en-us/azure/governance/policy/concepts/effects#append
append has details, deny has not.
The answer should be append