I am trying to use ArgoCD notification to my Teams channel, but it isn't sending notification. So, I followed documentation here
I created an Incoming Webhook in teams and get URL
I set it to argocd-notification secrets:
apiVersion: v1 kind: Secret metadata: name: argocd-notifications-secret stringData: channel-teams-url: mywebhookurl type: Opaque
Then I set up config map:
apiVersion: v1 kind: ConfigMap metadata: name: argocd-notifications-cm data: context: | argocdUrl: https://20.204.207.96 trigger.on-health-degraded: | when: app.status.health.status == 'Degraded' send: [app-on-health-degraded] trigger.on-deployed: | when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy' oncePer: app.status.sync.revision send: [app-sync-succeeded] service.teams: | recipientUrls: ArgoCD: $channel-teams-url template.app-on-health-degraded: | email: subject: Application {{.app.metadata.name}} has degraded. message: | Application {{.app.metadata.name}} has degraded. Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}. teams: facts: | [{ "name": "Sync Status", "value": "{{.app.status.sync.status}}" }, { "name": "Repository", "value": "{{.app.spec.source.repoURL}}" } {{range $index, $c := .app.status.conditions}} {{if not $index}},{{end}} {{if $index}},{{end}} { "name": "{{$c.type}}", "value": "{{$c.message}}", } {{end}} ] potentialAction: | [{ "@type":"OpenUri", "name":"Open Application", "targets":[{ "os":"default", "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}" }] }, { "@type":"OpenUri", "name":"Open Repository", "targets":[{ "os":"default", "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" }] }] title: Application {{.app.metadata.name}} has degraded. template.app-sync-succeeded: | teams: facts: | [{ "name": "Sync Status", "value": "{{.app.status.sync.status}}" }, { "name": "Repository", "value": "{{.app.spec.source.repoURL}}" }, { "name": "Revision", "value": "{{.app.status.sync.revision}}" } {{range $index, $c := .app.status.conditions}} {{if not $index}},{{end}} {{if $index}},{{end}} { "name": "{{$c.type}}", "value": "{{$c.message}}", } {{end}} ] potentialAction: |- [{ "@type":"OpenUri", "name":"Operation Application", "targets":[{ "os":"default", "uri":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}" }] }, { "@type":"OpenUri", "name":"Open Repository", "targets":[{ "os":"default", "uri":"{{.app.spec.source.repoURL | call .repo.RepoURLToHTTPS}}" }] }] title: New version of an application {{.app.metadata.name}} is up and running.
Then I subscribe it from application:
apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: dreambook-argo-application namespace: argocd annotations: notifications.argoproj.io/subscribe.on-sync-running.teams: ArgoCD notifications.argoproj.io/subscribe.on-deployed.teams: ArgoCD notifications.argoproj.io/subscribe.on-health-degraded: ArgoCD spec: project: default source: repoURL: myrepo url targetRevision: HEAD path: dev/deployment destination: server: https://kubernetes.default.svc namespace: myns syncPolicy: automated: prune: true selfHeal: true syncOptions: - Validate=false - Prune=true - SelfHeal=true
So, my channel in Teams is ArgoCD:
So, after CI/CD I am not getting any notification. Does anyone have this problem?