Estimated time: 10 minutes
In this task you will create a custom policy that requires resources to have a specific tag with a limited set of valid values. You will assign this policy to a resource group and verify the policy.
This task does not require any pre-requisite setup.
To begin this task you will Create a custom policy named RequireSensitivity. This policy will require that all resources governed by the policy have a Sensitivity tag with a value that matches one of the following:
To complete this requirement:
{
"mode":"All",
"policyRule": {
"if": {
"allof": [
{
"not": {
"field": "type",
"equals": "Microsoft.Resources/subscriptions/resourceGroups"
}
},
{
"anyof": [
{
"field": "tags['Sensitivity']",
"exists": false
},
{
"not":{
"field": "tags['Sensitivity']",
"in":["Public","General","Confidential","Highly confidential"]
}
}
]
}
]
},
"then": {
"effect": "deny"
}
}
}
Next you will provision a resource group named task-datasec-rg. You will then assign the SensitivityTag policy to the task-datasec-rg resource group.
Finally, you will attempt to provision a storage account in the task-datasec-rg resource group. You will make three attempts at provisioning the storage account:
Having trouble completing this task? View the demonstration video to see how to do it.