Post a message to Microsoft Teams
Post a message to a Microsoft Teams channel via an incoming-webhook URL read from a Kubernetes Secret.
Install v1.0.0
Installs the template into your Argo namespace. The URL is pinned to this version.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/microsoft-teams-post/1.0.0/template.yaml
Or with the Argo CLI:
argo template create -n argo https://catalog.dagweave.com/api/v1/items/microsoft-teams-post/1.0.0/template.yaml
Facts
- Category
- Notifications
- Tags
- notifications python
- Entrypoint
post- Template SHA-256
d66e18d7adc4951f27463a77e2c31b9ab3d13fd89236380dd0f39f6ba7c035cd- Source
- microsoft-teams-post at catalog commit 67458f7
- API
- item document, latest template.yaml
Images and provenance
Every image is pinned by digest, so a rebuilt tag can never change what this version runs.
| Repository | Tag | Digest |
|---|---|---|
python | none recorded | sha256:20a82dbc2783112ddb91d1534603f802d222a3e63e593cd002eb2ac534e70211 |
Parameters
| Name | Description | Default |
|---|---|---|
message required |
The message text to post to the Teams channel. | none |
webhook-secret-key |
Key within the Secret that holds the webhook URL. | url |
webhook-secret-name |
Name of the Kubernetes Secret in the run namespace holding the Teams incoming-webhook URL. | teams-webhook |
WorkflowTemplate
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: microsoft-teams-post
labels:
dagweave.io/catalog-item: microsoft-teams-post
annotations:
# The catalog semver this manifest was authored at. The dagweave app records
# (catalog-item-id, semver) -> content-hash -> base-vN when it mints the tenant
# cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.
dagweave.io/catalog-version: "1.0.0"
dagweave.io/catalog-category: "Notifications"
spec:
entrypoint: post
templates:
- name: post
inputs:
parameters:
# The message text to post to the Teams channel.
- name: message
# Name/key of the Kubernetes Secret in the run namespace holding the Teams
# incoming-webhook URL. Defaults let a user leave them blank in the Inspector.
- name: webhook-secret-name
default: teams-webhook
- name: webhook-secret-key
default: url
container:
# Pinned by digest per the catalog convention: an image rebuild can never
# silently change the behaviour of an already-released item version.
# python:3.15-alpine — a Teams incoming webhook expects a JSON body, so the
# payload is built with json.dumps (which correctly escapes any quotes,
# newlines or control characters in the message) rather than shell string
# assembly. urllib performs the POST, so no extra image is needed.
image: python@sha256:20a82dbc2783112ddb91d1534603f802d222a3e63e593cd002eb2ac534e70211
command: [python3, -c]
# Values arrive as env vars (below), never interpolated into the program
# source, so a message with any content is safe.
args:
- |
import json, os, urllib.request
payload = json.dumps({"text": os.environ["MESSAGE"]}).encode("utf-8")
req = urllib.request.Request(
os.environ["WEBHOOK_URL"],
data=payload,
headers={"Content-Type": "application/json"},
method="POST",
)
with urllib.request.urlopen(req) as resp:
print("Teams webhook responded:", resp.status)
env:
- name: MESSAGE
value: "{{inputs.parameters.message}}"
- name: WEBHOOK_URL
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.webhook-secret-name}}"
key: "{{inputs.parameters.webhook-secret-key}}"
Version history
Read from the item's changelog. Each version has its own JSON document; the pinned catalogue vendors the manifest of the latest one, so that is the version that installs.
-
1.0.0 latest 2026-07-16
Initial release.
kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/microsoft-teams-post/1.0.0/template.yamlargo template create -n argo https://catalog.dagweave.com/api/v1/items/microsoft-teams-post/1.0.0/template.yaml
Run it once
After installing, from the command line.
argo submit -n argo --from workflowtemplate/microsoft-teams-post \
-p message=...
Workflow that references it
A Workflow with the required parameters filled from the examples.
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: microsoft-teams-post-
spec:
workflowTemplateRef:
name: microsoft-teams-post
arguments:
parameters:
- name: message
value: "..."
As a step of a larger workflow
steps:
- - name: microsoft-teams-post
templateRef:
name: microsoft-teams-post
template: post