# Microsoft Teams

> The teams destination: Workflows webhooks.

Messages to a Microsoft Teams channel: the `teams` destination, from the `teams` package. Declare the package once in `dependencies.yml`; DRE installs it on demand:

dependencies.yml

```yaml
plugins:
  - teams
```

### Profile fields

Set in `profiles.yml`, under `destinations:`, in a target with `type: teams`.

Field

Default

Notes

`webhook_url` (required)

The Workflows webhook URL of the channel (keep it secret) Secret: use `env_var()`.

`connect_timeout`

`30s`

How long to wait for a connection (`30s`, `2m`, or seconds) A duration (`30s`, `2m`) or seconds.

`timeout`

`60s`

How long a read or write may make no progress before it fails. A duration (`30s`, `2m`) or seconds.

`retries`

`3`

How many times to try again after a temporary error (0: never)

## Notes

Posts [messages](https://getdre.com/docs/plugins/#the-message-format) to a Microsoft Teams channel through a Workflows webhook. It takes messages only: a file output, or `attach:`, sent to it is an error in `dre validate`. Deliver files to object storage and link them from the message with `outputs.<name>.location`. Released as `1.0.0-rc.1`.

The profile holds `webhook_url`, which is a credential: anyone with it can post to the channel. Set it with `env_var()`. DRE never logs it or shows it in an error.

profiles.yml

```yaml
destinations:
  finance_teams:
    targets:
      prod: {type: teams, webhook_url: "{{ env_var('TEAMS_FINANCE_WEBHOOK') }}"}
```

To create the webhook: in Teams, open the channel’s **…** menu > **Workflows**, choose **Post to a channel when a webhook request is received**, pick the team and channel, and copy the URL it shows. The message arrives as a card: the title in bold, then the text, with bold, italics, links and bullets. Teams has no destination options. A message over 15,000 characters is cut short with a note (the full text is in the run’s `.md` file and `run_results.json`), with a warning. A post Teams rate-limits or answers 503 to is tried again (see [Tries again](https://getdre.com/docs/plugins/#tries-again)).

## Adapt a headline to Teams

Start with the complete [headline example](https://github.com/get-dre/dre/blob/v0.5.1/examples/slack-headline/). Add `teams` to its dependencies, use the profile above, and replace the headline destination with `destination: {profile: finance_teams}`. Add `dev: {deliver: false}` beside the prod profile entry to keep local runs quiet. Run `dre run <report> --preview 5` to inspect the message.

`invalid-destination-option` on `attach` means Teams takes messages only; remove attachments and put a storage link in the text. `delivery-failed` after the workflow was removed needs a new webhook URL set through the environment variable. A truncated message needs shorter text; the warning is not a delivery failure. See [messages](https://getdre.com/docs/messages/), [destination keys](https://getdre.com/docs/reference-report/#outputdestination), [error codes](https://getdre.com/docs/reference-error-codes/) and [message](https://getdre.com/docs/glossary/#message).

[Edit page](https://github.com/get-dre/dre/edit/master/docs/plugin-teams.md)

[Previous  
Slack](https://getdre.com/docs/plugin-slack/)[Next  
Google Chat](https://getdre.com/docs/plugin-google_chat/)
