mirror of
https://dev.azure.com/effectory/Survey%20Software/_git/Cloud%20Engineering
synced 2026-02-27 18:52:18 +01:00
Added Creatondate consoleapp and tagging policy
This commit is contained in:
52
Policies/PolicyTagCreatedOnDate.json
Normal file
52
Policies/PolicyTagCreatedOnDate.json
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"properties": {
|
||||
"displayName": "PolicyTagCreatedOnDate",
|
||||
"policyType": "Custom",
|
||||
"mode": "All",
|
||||
"description": "This policy add created date tags on resources when they don't exist.",
|
||||
"metadata": {
|
||||
"category": "Tags",
|
||||
"createdBy": "c6025a2e-416c-42da-96ef-dd507382793a",
|
||||
"createdOn": "2022-04-15T15:01:28.525335Z",
|
||||
"updatedBy": "c6025a2e-416c-42da-96ef-dd507382793a",
|
||||
"updatedOn": "2022-04-19T08:12:35.0545303Z"
|
||||
},
|
||||
"parameters": {},
|
||||
"policyRule": {
|
||||
"if": {
|
||||
"allOf": [
|
||||
{
|
||||
"field": "tags['CreatedOnDate']",
|
||||
"exists": "false"
|
||||
}
|
||||
]
|
||||
},
|
||||
"then": {
|
||||
"effect": "modify",
|
||||
"details": {
|
||||
"roleDefinitionIds": [
|
||||
"/providers/microsoft.authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c"
|
||||
],
|
||||
"operations": [
|
||||
{
|
||||
"operation": "add",
|
||||
"field": "tags['CreatedOnDate']",
|
||||
"value": "[utcNow()]"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"id": "/providers/Microsoft.Management/managementGroups/e9792fd7-4044-47e7-a40d-3fba46f1cd09/providers/Microsoft.Authorization/policyDefinitions/7653268b-5004-4576-8946-5fd9d085e470",
|
||||
"type": "Microsoft.Authorization/policyDefinitions",
|
||||
"name": "7653268b-5004-4576-8946-5fd9d085e470",
|
||||
"systemData": {
|
||||
"createdBy": "jurjen.ladenius@effectory.com",
|
||||
"createdByType": "User",
|
||||
"createdAt": "2022-04-15T15:01:28.473525Z",
|
||||
"lastModifiedBy": "jurjen.ladenius@effectory.com",
|
||||
"lastModifiedByType": "User",
|
||||
"lastModifiedAt": "2022-04-19T08:12:35.0142798Z"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user