> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flexagon.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring FlexDeploy for Teams Webhook Operations

> Microsoft 365 Connector Retirement With the in Teams, the only supported approach of sending messages in Microsoft teams in through . The following pa

> [!NOTE]
>
> **Microsoft 365 Connector Retirement**
>
> With the [retirement of Office 365 connectors](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) in Teams, the only supported approach of sending messages in Microsoft teams in through [Microsoft Teams Workflows](https://support.microsoft.com/en-us/office/create-incoming-webhooks-with-workflows-for-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498).
>
> The following page will cover how to configure FlexDeploy **@since 9.0.0.1** to leverage Teams Workflows to send messages.

## Adding a Workflow in Teams to receive a webhook message

1. You will need to add a Workflow in Teams by clicking the three dot menu and selecting the **Workflows** application.

![image-20241204-202544.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937809.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=227585a52001d56938fc24f59d6e8ca2)

2. Once viewing the Workflows page, click the ![(blue star)](https://flexagon.atlassian.net/wiki/s/-510684821/6452/64e1779b1cc4eed32fd26c0f5af1f87b02d05b81/_/images/icons/emoticons/72/2795.png) **New Flow** button on the top right.

![image-20241204-202750.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937806.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=491cb3c42d48d24139330b4e7db87c56)

3. You can optionally select a template but for this walkthrough just click the ![(blue star)](https://flexagon.atlassian.net/wiki/s/-510684821/6452/64e1779b1cc4eed32fd26c0f5af1f87b02d05b81/_/images/icons/emoticons/72/2795.png) **Create from blank** button.

![image-20241204-203050.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937812.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=7f73d4b48000a9a06a3de46149cbf5ce)

4. The first step should be **When a Teams webhook request is received**

![image-20241204-203146.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937800.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=908c899aa235e235b6f399f792d44cf9)

5. Select **Anyone** for “Who can trigger the flow?” and click on the ![(blue star)](https://flexagon.atlassian.net/wiki/s/-510684821/6452/64e1779b1cc4eed32fd26c0f5af1f87b02d05b81/_/images/icons/emoticons/72/2795.png) **New Step** button.

![image-20241204-203335.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937803.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=7e3c933a3587c4f281af7b36852c77e1)

6. The second and final step should be **Post card in a chat or channel**.

![image-20241204-203506.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937797.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=de3afb9736f9813609825c2131b29f1c)

7. Specify which Team, Channel, or Group Chat you want to post the message to. Finally select **Body** as the Adaptive Card content. Body represents the entire input payload that will be sent to the webhook.

> [!NOTE]
>
> **If you do not see Body** as an available option, then try saving your workflow, closing it, and re-editing it.

![image-20241204-204317.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937791.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=dcc263dc2427badcf9a9cb3aef4144cb)

8. Save your Workflow and re-open the first step so you can copy the webhook URL.

![image-20241204-204713.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937794.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=c72cc80a7303dad511bf11c0245bcd62)

## Using the Webhook URL from the Teams Workflow

The Webhook URL copied from the Teams Workflow is what will be used when configuring Plugin Operations and using our `MICROSOFTTEAMS` groovy helper.

### Posting Messages with MICROSOFTTEAMS helper

The following script creates and posts a message that leverages most of the card features supported by our `MicrosoftTeamsMessageCard` helper class.

```
import flexagon.ffi.microsoftteams.pojos.MicrosoftTeamsMessageCard;

LOG.info("Running function: ${FUNCTION_NAME}");

def teams_url= "YOUR_WEBHOOK_URL_COPIED_FROM_ABOVE"

MicrosoftTeamsMessageCard card = new MicrosoftTeamsMessageCard()
card.setTitle("Main Title")
card.setActivityTitle("Card Subtitle")

card.setIconUrl("https://png.pngtree.com/element_pic/00/16/09/2057e0eecf792fb.jpg")
card.setSectionText("This is the main body of the card. This is longer form content.")

card.addFact("Fact 1", "This is neat huh")
card.addFact("Fact 2", "I sure think so")

card.addAction("Action.OpenUrl", ["url":"https://google.com", "title":"Open Google"])

card.setTableHeaders(["Project", "Workflow", "Release"])
card.addTableRow(["Samples", "BuildGit", "Weekly Release"])
card.addTableRow(["Natours", "BuildGit", "Monthly Release"])

MICROSOFTTEAMS.sendTeamsWebhookMessage(teams_url, card)
```

The final result looks like the following:

![image-20241204-205527.png](https://mintcdn.com/flexagon-llc-ce77a95c/NkeZh5D-Nf8j_WaD/images/fd111/12590937788.png?fit=max\&auto=format\&n=NkeZh5D-Nf8j_WaD\&q=85\&s=e10209a049407a0ee1ff72f707ac32f5)

## Authoring Adaptive Cards

Both the MICROSOFTTEAMS helper and Plugin Operations support passing a json string which allows the full Adaptive Card schema to be leveraged.

Microsoft provides a webpage to view the schema and a playground to create your own messages, which can be found below.

[https://adaptivecards.io/explorer/AdaptiveCard.html](https://adaptivecards.io/explorer/AdaptiveCard.html)

[https://adaptivecards.io/designer/](https://adaptivecards.io/designer/)

## Setting up Certificates

You may need to install the certificate for [https://graph.microsoft.com/.default](https://graph.microsoft.com/.default) into your Java keystore. If this is the case, you will get an error about building a certificate path.
