Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit d45ac5f

Browse files
docs: improve teams docs (#248)
Signed-off-by: Ryota Sakamoto <[email protected]>
1 parent f2c813b commit d45ac5f

File tree

1 file changed

+73
-4
lines changed

1 file changed

+73
-4
lines changed

docs/services/teams.md

Lines changed: 73 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
# Teams
22

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+
311
1. Open `Teams` and goto `Apps`
412
2. Find `Incoming Webhook` microsoft app and click on it
513
3. Press `Add to a team` -> select team and channel -> press `Set up a connector`
614
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`
916

1017
```yaml
1118
apiVersion: v1
@@ -18,12 +25,74 @@ data:
1825
channelName: $channel-teams-url
1926
```
2027
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:
2238
2339
```yaml
2440
apiVersion: argoproj.io/v1alpha1
2541
kind: Application
2642
metadata:
2743
annotations:
2844
notifications.argoproj.io/subscribe.on-sync-succeeded.teams: channelName
29-
```
45+
```
46+
47+
## Templates
48+
49+
![](https://user-images.githubusercontent.com/18019529/114271500-9d2b8880-9a4c-11eb-85c1-f6935f0431d5.png)
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

Comments
 (0)