github.com/argoproj/argo-cd/v2@v2.10.9/docs/operator-manual/notifications/services/teams.md (about)

     1  # Teams
     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  
    11  1. Open `Teams` and goto `Apps`
    12  2. Find `Incoming Webhook` microsoft app and click on it
    13  3. Press `Add to a team` -> select team and channel -> press `Set up a connector`
    14  4. Enter webhook name and upload image (optional)
    15  5. Press `Create` then copy webhook url and store it in `argocd-notifications-secret` and define it in `argocd-notifications-cm`
    16  
    17  ```yaml
    18  apiVersion: v1
    19  kind: ConfigMap
    20  metadata:
    21    name: <config-map-name>
    22  data:
    23    service.teams: |
    24      recipientUrls:
    25        channelName: $channel-teams-url
    26  ```
    27  
    28  ```yaml
    29  apiVersion: v1
    30  kind: Secret
    31  metadata:
    32    name: <secret-name>
    33  stringData:
    34    channel-teams-url: https://example.com
    35  ```
    36  
    37  6. Create subscription for your Teams integration:
    38  
    39  ```yaml
    40  apiVersion: argoproj.io/v1alpha1
    41  kind: Application
    42  metadata:
    43    annotations:
    44      notifications.argoproj.io/subscribe.on-sync-succeeded.teams: channelName
    45  ```
    46  
    47  ## Templates
    48  
    49  ![](https://user-images.githubusercontent.com/18019529/114271500-9d2b8880-9a4c-11eb-85c1-f6935f0431d5.png)
    50  
    51  [Notification templates](../templates.md) can be customized to leverage teams message sections, facts, themeColor, summary 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      themeColor: "#000080"
    57      sections: |
    58        [{
    59          "facts": [
    60            {
    61              "name": "Sync Status",
    62              "value": "{{.app.status.sync.status}}"
    63            },
    64            {
    65              "name": "Repository",
    66              "value": "{{.app.spec.source.repoURL}}"
    67            }
    68          ]
    69        }]
    70      potentialAction: |-
    71        [{
    72          "@type":"OpenUri",
    73          "name":"Operation Details",
    74          "targets":[{
    75            "os":"default",
    76            "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true"
    77          }]
    78        }]
    79      title: Application {{.app.metadata.name}} has been successfully synced
    80      text: Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
    81      summary: "{{.app.metadata.name}} sync succeeded"
    82  ```
    83  
    84  ### facts field
    85  
    86  You can use `facts` field instead of `sections` field.
    87  
    88  ```yaml
    89  template.app-sync-succeeded: |
    90    teams:
    91      facts: |
    92        [{
    93          "name": "Sync Status",
    94          "value": "{{.app.status.sync.status}}"
    95        },
    96        {
    97          "name": "Repository",
    98          "value": "{{.app.spec.source.repoURL}}"
    99        }]
   100  ```
   101  
   102  ### theme color field
   103  
   104  You can set theme color as hex string for the message.
   105  
   106  ![](https://user-images.githubusercontent.com/1164159/114864810-0718a900-9e24-11eb-8127-8d95da9544c1.png)
   107  
   108  ```yaml
   109  template.app-sync-succeeded: |
   110    teams:
   111      themeColor: "#000080"
   112  ```
   113  
   114  ### summary field
   115  
   116  You can set a summary of the message that will be shown on Notification & Activity Feed 
   117  
   118  ![](https://user-images.githubusercontent.com/6957724/116587921-84c4d480-a94d-11eb-9da4-f365151a12e7.jpg)
   119  
   120  ![](https://user-images.githubusercontent.com/6957724/116588002-99a16800-a94d-11eb-807f-8626eb53b980.jpg)
   121  
   122  ```yaml
   123  template.app-sync-succeeded: |
   124    teams:
   125      summary: "Sync Succeeded"
   126  ```