-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
ContainerInstance_LogAnalytics_Append.json
77 lines (77 loc) · 2.39 KB
/
ContainerInstance_LogAnalytics_Append.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
"properties": {
"displayName": "Configure diagnostics for container group to log analytics workspace",
"policyType": "BuiltIn",
"mode": "All",
"description": "Appends the specified log analytics workspaceId and workspaceKey when any container group which is missing these fields is created or updated. Does not modify the fields of container groups created before this policy was applied until those resource groups are changed.",
"metadata": {
"version": "1.0.0",
"category": "Container Instances"
},
"version": "1.0.0",
"parameters": {
"effect": {
"type": "String",
"metadata": {
"displayName": "Effect",
"description": "Enable or disable the execution of the policy"
},
"allowedValues": [
"Append",
"Disabled"
],
"defaultValue": "Append"
},
"workspaceId": {
"type": "String",
"metadata": {
"displayName": "Workspace ID",
"description": "Log Analytics workspace GUID"
}
},
"workspaceKey": {
"type": "String",
"metadata": {
"displayName": "Workspace Key",
"description": "Log Analytics workspace key"
}
}
},
"policyRule": {
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.ContainerInstance/containerGroups"
},
{
"field": "Microsoft.ContainerInstance/containerGroups/diagnostics.logAnalytics.workspaceId",
"exists": "false"
},
{
"field": "Microsoft.ContainerInstance/containerGroups/diagnostics.logAnalytics.workspaceKey",
"exists": "false"
}
]
},
"then": {
"effect": "[parameters('effect')]",
"details": [
{
"field": "Microsoft.ContainerInstance/containerGroups/diagnostics.logAnalytics.workspaceId",
"value": "[parameters('workspaceId')]"
},
{
"field": "Microsoft.ContainerInstance/containerGroups/diagnostics.logAnalytics.workspaceKey",
"value": "[parameters('workspaceKey')]"
}
]
}
},
"versions": [
"1.0.0"
]
},
"id": "/providers/Microsoft.Authorization/policyDefinitions/21c469fa-a887-4363-88a9-60bfd6911a15",
"name": "21c469fa-a887-4363-88a9-60bfd6911a15"
}