Description
Hi, I am trying to setup the Alertmanager Teams integration for the first time - we have setup the Teams side as described at https://support.microsoft.com/en-gb/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498 and the Alertmanager config looks like this (we are using the kube prometheus stack):
apiVersion: monitoring.coreos.com/v1alpha1
kind: AlertmanagerConfig
metadata:
name: teams-routing
namespace: d52
spec:
route:
groupBy: ['alertname']
receiver: 'teams-webhook'
groupWait: 30s
groupInterval: 5m
repeatInterval: 3h
routes:
- matchers:
- name: severity
matchType: '='
value: warning
- name: namespace
matchType: '='
value: d52
receiver: 'teams-webhook'
receivers:
- name: "teams-webhook"
msteamsv2Configs:
- webhookURL:
name: alertmanager-secret
key: url
sendResolved: true
title: '{{ template "msteamsv2.default.title" . }}'
text: '{{ template "msteamsv2.default.text" . }}'
I can use curl to successfully send a request to the Teams URL and see it appear in our Teams channel, but the integration is not working correctly. In Alertmanager logs I see
time=2025-06-18T12:25:33.578Z level=ERROR source=dispatch.go:360 msg="Notify for alerts failed" component=dispatcher num_alerts=1 err="d52/teams-routing/teams-webhook/msteamsv2[0]: notify retry canceled due to unrecoverable error after 1 attempts: unexpected status code 400: {\"code\":\"ApiVersionInvalid\",\"message\":\"API version must be specified using the api-version query string parameter. Supported API versions are: 2024-10-01, 2022-03-01-preview, 2021-10-01-preview\",\"innererror\":{\"code\":\"ApiVersionRequired\"}}"
And in the MS Power Automate console the error shows as
Action 'Send_each_adaptive_card' failed: The execution of template action 'Send_each_adaptive_card' failed: the result of the evaluation of 'foreach' expression '@triggerBody()?['attachments']' is of type 'Null'. The result must be a valid array.
I have read through previous issues such as #3920 but I believe the modifications to workflows that were suggested were for the msteams_config (v1) receiver type - is there a definitive guide or set of instructions for getting this working for v2 at all? Thanks (We're using Alertmanager v0.28.1)