1
1
# Teams
2
2
3
+ ## Parameters
4
+
5
+ The Teams notification service send message notifications using Teams bot and requires specifying the following settings:
6
+
7
+ * ` recipientUrls ` - the webhook url map, e.g. ` channelName: https://example.com `
8
+
9
+ ## Configuration
10
+
3
11
1 . Open ` Teams ` and goto ` Apps `
4
12
2 . Find ` Incoming Webhook ` microsoft app and click on it
5
13
3 . Press ` Add to a team ` -> select team and channel -> press ` Set up a connector `
6
14
4 . Enter webhook name and upload image (optional)
7
- 5 . Press ` Create ` then copy webhook url and store it in ` argocd_notifications-secret `
8
- 6 . in ` argocd-notifications-cm ` ConfigMap:
15
+ 5 . Press ` Create ` then copy webhook url and store it in ` argocd-notifications-secret ` and define it in ` argocd-notifications-cm `
9
16
10
17
``` yaml
11
18
apiVersion : v1
@@ -18,12 +25,74 @@ data:
18
25
channelName: $channel-teams-url
19
26
` ` `
20
27
21
- 7. Create subscription for your Teams integration:
28
+ ` ` ` yaml
29
+ apiVersion : v1
30
+ kind : Secret
31
+ metadata :
32
+ name : argocd-notifications-secret
33
+ stringData :
34
+ channel-teams-url : https://example.com
35
+ ` ` `
36
+
37
+ 6. Create subscription for your Teams integration:
22
38
23
39
` ` ` yaml
24
40
apiVersion : argoproj.io/v1alpha1
25
41
kind : Application
26
42
metadata :
27
43
annotations :
28
44
notifications.argoproj.io/subscribe.on-sync-succeeded.teams : channelName
29
- ` ` `
45
+ ` ` `
46
+
47
+ ## Templates
48
+
49
+ 
50
+
51
+ Notification templates can be customized to leverage teams message sections, facts and potentialAction [feature](https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using).
52
+
53
+ ` ` ` yaml
54
+ template.app-sync-succeeded : |
55
+ teams:
56
+ sections: |
57
+ [{
58
+ "facts": [
59
+ {
60
+ "name": "Sync Status",
61
+ "value": "{{.app.status.sync.status}}"
62
+ },
63
+ {
64
+ "name": "Repository",
65
+ "value": "{{.app.spec.source.repoURL}}"
66
+ }
67
+ ]
68
+ }]
69
+ potentialAction: |-
70
+ [{
71
+ "@type":"OpenUri",
72
+ "name":"Operation Details",
73
+ "targets":[{
74
+ "os":"default",
75
+ "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
76
+ }]
77
+ }]
78
+ title: Application {{.app.metadata.name}} has been successfully synced
79
+ text: Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
80
+ ` ` `
81
+
82
+ ### facts field
83
+
84
+ You can use ` facts` field instead of `sections` field.
85
+
86
+ ` ` ` yaml
87
+ template.app-sync-succeeded: |
88
+ teams:
89
+ facts: |
90
+ [{
91
+ "name": "Sync Status",
92
+ "value": "{{.app.status.sync.status}}"
93
+ },
94
+ {
95
+ "name": "Repository",
96
+ "value": "{{.app.spec.source.repoURL}}"
97
+ }]
98
+ ` ` `
0 commit comments