---
title: Microsoft Teams
description: >-
  Microsoft Teams is the chat-based workspace in Office 365 that integrates
  people, content, and tools.
breadcrumbs: Docs > Integrations > Microsoft Teams
---

# Microsoft Teams

## Overview{% #overview %}

Integrate with Microsoft Teams to:

- Be notified of Datadog alerts and events in Microsoft Teams.
- Mute triggered monitors directly from Microsoft Teams.
- Manage incidents from within Microsoft Teams (Not supported for US1-FED).

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

**Note**: While your Datadog account is hosted in the secure US1-FED environment, you are responsible for managing the security of your Microsoft Teams environment, including access, permissions, and data protection.
{% /callout %}

## Setup{% #setup %}

{% tab title="Datadog App (Recommended)" %}
### Send monitor notifications to a Microsoft Teams channel{% #send-monitor-notifications-to-a-microsoft-teams-channel %}

Connect your Microsoft tenant to Datadog.

1. In Datadog, navigate to [**Integrations > Microsoft Teams**](https://app.datadoghq.com/integrations/microsoft-teams).
1. Click **Add Tenant**, which redirects you to Microsoft.
1. Follow the prompts and click **OK**.

Ensure you have added the  app to all teams where you want to receive Datadog notifications.

1. Open Microsoft Teams.
1. In the vertical toolbar, click **Apps**.
1. Search for "" and click on **Open**.
1. In the modal that opens, select the primary channel of the team where the app should be added. Click **Go** to complete the installation.

Once the bot has been added to the team, configure the notification handle in Datadog.

1. Under a configured tenant, click **Add Handle**. Give the handle a name, select the desired team and channel from the drop-down menus, and click **Save**.

### Migrate legacy connectors to tenant-based integration{% #migrate-legacy-connectors-to-tenant-based-integration %}

Microsoft has announced that Office 365 connectors for Microsoft Teams are being deprecated. This has the following effects:

- All Datadog Connectors will stop working on January 31, 2025.
- Incoming Webhook Connectors without [updated URLs](https://learn.microsoft.com/microsoftteams/m365-custom-connectors#update-connectors-url) will stop working on January 31, 2025.
- All connectors will stop working on April 30, 2026 (previously October 1, 2024).

See Microsoft's [blog post](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) for more information.

To migrate all notification handles currently using the legacy Office 365 connectors over to Datadog's tenant-based integration:

1. Follow the setup steps to connect your Microsoft tenant to Datadog.
1. Add the  app to all teams where you have a legacy Office 365 connector configured.
1. For each legacy notification connector handle in the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams):
   1. Under the configured tenant, click **Add Handle**.
   1. Give the new handle the same name as the connector handle. For example, if your legacy connector handle is named `channel-123`, create a new handle in the tenant configuration with the name `channel-123`.
   1. Select the desired team and channel from the drop-down menus that the legacy connector handle was sending the message to, and click **Save**. This new handle overrides the existing legacy connector handle.

### Usage{% #usage %}

From a Datadog monitor, send a notification to Microsoft Teams using the [`@-notification` feature](https://docs.datadoghq.com/monitors/notify/#notification). Send the notification to the address `@teams-<HANDLE>`, replacing `<HANDLE>` with the name of your Microsoft Teams handle. To mute a triggered monitor from Microsoft Teams, click **Mute Monitor**, select a **Mute Duration**, and click **Mute**.

#### User mentions{% #user-mentions %}

User mentions allow you to notify specific users in your Microsoft Teams channels when monitor alerts are triggered. This helps ensure that the right people are notified about important events. To mention a specific user, follow the steps below to find their User Principal Name (UPN).

**Syntax**: `<at>{User Principal Name}</at>`

**Example**: `<at>user@microsoft.com</at>`

**Complete notification example**: `@teams-CHANNEL_NAME <at>user@microsoft.com</at> <at>another.user@microsoft.com</at>`

**To find a user's User Principal Name (UPN):**

1. **Method 1 (only works if UPN matches email):**

   - In Microsoft Teams, click on the user's profile picture or name to open their contact card.
   - The email shown in the `Chat` field is often the UPN. If they differ, use Method 2 below.

1. **Method 2 (always works, but requires Azure Portal permissions):**

   - Sign in to the [Microsoft Azure Portal](https://portal.azure.com).
   - Navigate to `Microsoft Entra ID` > `Manage` > `Users`
   - Locate the user in the list and copy their UPN from the `User principal name` column.

Datadog recommends testing your monitor notifications to ensure reliable delivery. See [Test notifications](https://docs.datadoghq.com/monitors/notify/#test-notifications) for instructions.

#### Dashboards{% #dashboards %}

You can post dashboard widget snapshots on any team or chat. For a list of supported widgets, see [Scheduled Reports](https://docs.datadoghq.com/dashboards/sharing/scheduled_reports/).

To share a dashboard widget in Teams:

1. In Datadog, hover over a dashboard widget and press `CMD + C` or `CTRL + C`, or click the **Copy** button from the share menu.
1. Paste the link into Teams.

### Limit edit access{% #limit-edit-access %}

By default, all users have full access to connected Microsoft Teams tenants.

Use [Granular Access Control](https://docs.datadoghq.com/account_management/rbac/granular_access/) to limit which roles can edit a specific tenant:

1. While viewing a tenant, click the gear icon in the upper-right corner to open the settings menu.
1. Select **Permissions**.
1. Click **Restrict Access**. The dialog box updates to show that members of your organization have **Viewer** access by default.
1. Use the dropdown to select one or more roles, teams, or users that can edit the Microsoft Teams tenant.
1. Click **Add**. The dialog box updates to show that the role you selected has the **Editor** permission.
1. Click **Save**.

**Note:** To maintain your edit access to the tenant, you must include at least one role you belong to before saving.

If you have edit access, you can restore general access to a restricted tenant by completing the following steps:

1. While viewing the tenant, click the gear icon in the upper-right corner to open the settings menu.
1. Select **Permissions**.
1. Click **Restore Full Access**.
1. Click **Save**.

{% /tab %}

{% tab title="Microsoft Workflows Webhooks" %}
### What are Microsoft Workflows Webhooks?{% #what-are-microsoft-workflows-webhooks %}

Workflows / Power Automate is a Microsoft product for creating automated workflows. Microsoft Workflows can be used to send notifications with incoming webhooks. If you are unable to install the Datadog app in your Microsoft Teams tenant (recommended), or you want to send notifications to private channels, you can configure Datadog handles to send notifications to Microsoft Teams channels through Microsoft Workflows. This integration is intended for use with the following Microsoft Workflows template: [Post to a channel when a webhook request is received](https://make.preview.powerautomate.com/galleries/public/templates/d271a6f01c2545a28348d8f2cddf4c8f/post-to-a-channel-when-a-webhook-request-is-received)

{% image
   source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_template.58b2814a334c4bac41719a2d44fc1596.png?auto=format"
   alt="Post to a channel when a webhook request is received template" /%}

### Are you migrating legacy connectors to the Microsoft Workflows Webhooks integration?{% #are-you-migrating-legacy-connectors-to-the-microsoft-workflows-webhooks-integration %}

Microsoft [has announced](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) that Office 365 connectors for Microsoft Teams are being deprecated, and existing connector URLs will stop working on January 31, 2025. Microsoft promotes using incoming webhooks from Microsoft Workflows as a replacement for legacy connectors. Follow the steps below to migrate all notification handles currently using legacy Office 365 connectors over to Datadog's Microsoft Workflows webhooks integration.

For each legacy notification connector handle in the Microsoft Teams Integration Tile:

1. Follow the setup steps to create a workflow webhook handle for the desired Microsoft Teams channel.
1. Under the Microsoft Workflows Webhooks section, give the new handle the same name as the connector handle it should replace. For example, if your legacy connector handle is named `channel-123`, name your new handle in the Microsoft Workflows Webhooks section with the name `channel-123`. This new handle overrides the existing legacy connector handle.

### Create a Microsoft Workflows Webhook{% #create-a-microsoft-workflows-webhook %}

#### Prerequisites{% #prerequisites %}

- When creating a new workflow, a Microsoft account is required for both ownership of the workflow and sending notifications to channels (these do not need to be the same Microsoft account).
- The account that owns the workflow (configured in step 2 below) is the account that can edit and renew the workflow. For easier shared access, use a service account.
- The account that sends notifications to channels (configured in step 8 below) posts as the user of the account. This account must be part of the team that you want to send notifications to. If sending notifications to a private channel, then this account must be also be added to the channel. If you want to give this account a name like "Datadog Notifications," use a service account.

#### Instructions{% #instructions %}

**Note:** Most of these steps are in Microsoft Workflows. As Microsoft makes changes to Workflows, the steps below may not reflect the most recent changes.

1. In Microsoft Teams, add the [Workflows app](https://teams.microsoft.com/l/app/c3a1996d-db0f-4857-a6ea-7aabf0266b00?source=app-details-dialog) to all teams you want to notify. If you are unable to add the app to your team, follow the instructions in the "Private channels" section below.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_1.a104f0d324b79a93d67ecd882f020a9b.png?auto=format"
      alt="Instructions step 1" /%}

1. Create a new workflow in Power Automate from Microsoft's [Post to a channel when a webhook request is received](https://make.preview.powerautomate.com/galleries/public/templates/d271a6f01c2545a28348d8f2cddf4c8f/post-to-a-channel-when-a-webhook-request-is-received) template.

1. Choose the Microsoft account that you would like to use to own the workflow (use a service account for easier shared access), then click **Continue**.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_3.542f16bb58cc9b6c4fd925f5c569ebee.png?auto=format"
      alt="Instructions step 3" /%}

1. Click **Edit in advanced mode**.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_4.15dde5432644c4bff12ecb049542a59e.png?auto=format"
      alt="Instructions step 4" /%}

1. Expand **Send each adaptive card**, then click **Post card in a chat or channel**.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_template_dropdown_step_5.373118f38762da22988bc16078a45610.png?auto=format"
      alt="Instructions step 5" /%}

1. Use the **Post As** dropdown to set **Post as** to **Flow bot**. Notifications will appear to be sent by "`<NAME>` via Workflows". To receive these notifications, the Workflows application must be added to the desired team. If sending notifications to a private channel, **Post As** must be set to a user in the channel. See the "Private channels" section below for more information. **Note:** Changing **Post as** will reset the **Post in** field.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_6.4d55b914751a5fed35ed765a286e316c.png?auto=format"
      alt="Instructions step 6" /%}

1. To access the team and channel drop-downs, remove the @ symbols by deleting them or clicking the **X** icons.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_7.ab824c1ff72c2e38d348bc3083af08c1.png?auto=format"
      alt="Instructions step 7" /%}

1. Use the drop-downs to select the desired team and channel.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_8.a405ff8f310026056b3198568616bbba.png?auto=format"
      alt="Instructions step 8" /%}

1. Ensure that the workflow is connected to the intended Microsoft account for sending notifications (such as a service account named "Datadog Notifications"). Notifications will appear to be sent by "`<NAME>` through Workflows". This account must have access to the configured Microsoft Teams channel. To change the account, click **Change connection** and follow the prompts to configure another Microsoft account.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_9.46f2bb3c991ac2fd4de52a794ba1bdcc.png?auto=format"
      alt="Instructions step 9" /%}

1. Click the **Save** button.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_10.9df2c9495365d7158dedf2eec6fbce1b.png?auto=format"
      alt="Instructions step 10" /%}

1. To find your webhook link, click the first block of the workflow.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_11.12146e7c5ef56df1db3f9e70194414ac.png?auto=format"
      alt="Instructions step 11" /%}

1. Make sure that **Anyone** can trigger the flow, and then copy the link.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_12.12444716e283f116fe3c7eecd2e57b7c.png?auto=format"
      alt="Instructions step 12" /%}

1. Click the **Back** button to navigate to the dashboard for the workflow.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_13.46bfb34e3c51e4cbe5a63ae1cb542c8a.png?auto=format"
      alt="Instructions step 13" /%}

1. Ensure that the workflow is on by checking the dashboard. If it is off, click the "Turn on" button.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_step_14.d4745614b195036f0449a6222190438f.png?auto=format"
      alt="Instructions step 14" /%}

1. In Datadog, navigate to [**Integrations > Microsoft Teams**](https://app.datadoghq.com/integrations/microsoft-teams).

1. On the Configuration tab, go to the Microsoft Workflows Webhooks section and click **Add Handle**. Give the handle a name (if migrating from a legacy connector handle, use the same name as the corresponding connector handle), and paste the webhook URL.

1. Click **Save**.

### Private channels{% #private-channels %}

To send notifications to private channels, the account configured within the **Post Card to chat or channel** block must have access to the channel. This enables the workflow to send notifications on behalf of that user account.

1. Within the **Post Card to chat or channel** block, change **Post as** to **User**.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_private_channels_step_1.d855ae1836a58d9b09c70b1937c2368b.png?auto=format"
      alt="Private channels instructions step 1" /%}

1. Then to choose the account, click **Change connection** and follow the prompts to change the account.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_private_channels_step_2.46f2bb3c991ac2fd4de52a794ba1bdcc.png?auto=format"
      alt="Private channels instructions step 2" /%}

### Limitations{% #limitations %}

- If you are a Microsoft 365 customer, workflows will automatically turn off after 90 days of no successful triggers. When a workflow is nearing expiration, Microsoft sends an email to the account that owns the workflow. This 90 day timer can be reset by running a test within Microsoft Workflows.

- When using the template, all messages are appended with a line of text stating who created the workflow along with a link to the template.

  {% image
     source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_workflows_used_a_template.46148fd0c8d0be2ac162ac152e54724c.png?auto=format"
     alt="User used a template" /%}

To remove this, go to your workflow and click **Save As** to make a copy, navigate to the copy by finding it within **My Flows**, and use the new webhook from the copied workflow instead of the original workflow.

- Microsoft Workflows does not support interactive features for the messages that it posts (such as muting monitors directly from Microsoft Teams).

- Microsoft Workflows does not support shared channels.

- Microsoft Workflows does not support user mentions when posting a Workflows Webhook as a User.

### Usage{% #usage %}

From a Datadog monitor, send a notification to Microsoft Teams using the [`@-notification` feature](https://docs.datadoghq.com/monitors/notify/#notification). Send the notification to the address `@teams-<HANDLE>`, replacing `<HANDLE>` with the name of your Microsoft Teams handle.

#### User mentions with Microsoft Workflows Webhooks handles{% #user-mentions-with-microsoft-workflows-webhooks-handles %}

User mentions allow you to notify specific users in your Microsoft Teams channels when monitor alerts are triggered. This helps ensure that the right people are notified about important events. To mention a specific user, follow the steps below to find their User Principal Name (UPN).

**Syntax**: `<at>{User Principal Name}</at>`

**Example**: `<at>user@microsoft.com</at>`

**Complete notification example**: `@teams-CHANNEL_NAME <at>user@microsoft.com</at> <at>another.user@microsoft.com</at>`

**To find a user's User Principal Name (UPN):**

1. **Method 1 (only works if UPN matches email):**

   - In Microsoft Teams, click on the user's profile picture or name to open their contact card.
   - The email shown in the `Chat` field is often the UPN. If they differ, use Method 2 below.

1. **Method 2 (always works, but requires Azure Portal permissions):**

   - Sign in to the [Microsoft Azure Portal](https://portal.azure.com).
   - Navigate to `Microsoft Entra ID` > `Manage` > `Users`
   - Locate the user in the list and copy their UPN from the `User principal name` column.

{% alert level="warning" %}
User mentions are NOT supported for Workflows Webhook handles posted as a User (for private channels). Including a user mention when posting a Workflows Webhook as a user will fail. To include user mentions using Workflows Webhooks, you must use the Flow Bot.
{% /alert %}

Datadog recommends testing your monitor notifications to ensure reliable delivery, see [Test notifications](https://docs.datadoghq.com/monitors/notify/#test-notifications) for instructions.

### Limit edit access{% #limit-edit-access %}

By default, all users have full access to each Microsoft Workflows webhook handle.

Use [Granular Access Control](https://docs.datadoghq.com/account_management/rbac/granular_access/) to limit which roles can edit a specific Workflows webhook handle:

1. While viewing the **Workflows Webhooks**, hover over a handle to reveal actions on the right side of the row.
1. Click the lock icon labeled **Permissions**.
1. Click **Restrict Access**. The dialog box updates to show that members of your organization have **Viewer** access by default.
1. Use the dropdown to select one or more roles, teams, or users that can edit the Workflows webhook handle.
1. Click **Add**. The dialog box updates to show that the role you selected has the **Editor** permission.
1. Click **Save**.

**Note:** To maintain your edit access to the Workflows webhook handle, you must include at least one role you belong to before saving.

If you have edit access, you can restore general access to a restricted Workflows webhook handle by completing the following steps:

1. While viewing the **Workflows Webhooks**, hover over the restricted handle to reveal actions on the right side of the row.
1. Click the lock icon labeled **Permissions**.
1. Click **Restore Full Access**.
1. Click **Save**.

To edit Workflows Webhooks permissions through the API:

1. Fetch the Workflows Webhooks IDs using the [Microsoft Teams Integration API](https://docs.datadoghq.com/api/latest/microsoft-teams-integration/#get-all-workflows-webhook-handles).
1. Use the [Restriction Policies API](https://docs.datadoghq.com/api/latest/restriction-policies/), where the Resource Type is `integration-webhook` and the id is `microsoft-teams:<workflows_webhook_id>`.

{% /tab %}

{% tab title="Connectors (Deprecated)" %}
### Migrate legacy connectors to tenant-based integration{% #migrate-legacy-connectors-to-tenant-based-integration %}

Microsoft has announced that Office 365 connectors for Microsoft Teams are being deprecated. This has the following effects:

- All Datadog Connectors will stop working on January 31, 2025.
- Incoming Webhook Connectors without [updated URLs](https://learn.microsoft.com/microsoftteams/m365-custom-connectors#update-connectors-url) will stop working on January 31, 2025.
- All connectors will stop working on April 30, 2026 (previously October 1, 2024).

See Microsoft's [blog post](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) for more information.

To migrate all notification handles currently using the legacy Office 365 connectors over to the tenant-based Datadog app:

1. Follow the [setup steps](https://docs.datadoghq.com/integrations/microsoft-teams/?tab=datadogapprecommended#setup) to connect your Microsoft tenant to Datadog.
1. Add the  app to all teams where you have a legacy Office 365 connector configured.
1. For each legacy notification connector handle in the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams):
   1. Under the configured tenant, click **Add Handle**.
   1. Give the new handle the same name as the connector handle. For example, if your legacy connector handle is named `channel-123`, create a new handle in the tenant configuration with the name `channel-123`.
   1. Select the desired team and channel from the drop-down menus that the legacy connector handle was sending the message to, and click **Save**. This new handle overrides the existing legacy connector handle.

### Migrate from legacy connectors to the Microsoft Workflows Webhooks integration{% #migrate-from-legacy-connectors-to-the-microsoft-workflows-webhooks-integration %}

Microsoft has announced that Office 365 connectors for Microsoft Teams are being deprecated. This has the following effects:

- All Datadog Connectors will stop working on January 31, 2025.
- Incoming Webhook Connectors without [updated URLs](https://learn.microsoft.com/microsoftteams/m365-custom-connectors#update-connectors-url) will stop working on January 31, 2025.
- All connectors will stop working on April 30, 2026 (previously October 1, 2024).

See Microsoft's [blog post](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) for more information.

To migrate all notification handles currently using the legacy Office 365 connectors over to Datadog's Microsoft Workflows webhooks integration, see [Microsoft Workflows Webhooks](https://docs.datadoghq.com/integrations/microsoft-teams/?tab=microsoftworkflowswebhooks#what-are-microsoft-workflows-webhooks).

### Connector setup (deprecated){% #connector-setup-deprecated %}

{% alert level="info" %}
Legacy notification handles are not affected by the new setup *unless* you use the same `@teams-HANDLE_NAME`, in which case the new configuration overrides the legacy configuration.
{% /alert %}

1. Choose the `...` button next to the channel name in the list of channels and then choose **Connectors**.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_team_step_1_v2.0cb87d10baf44c79e84772500aca5ff9.png?auto=format"
      alt="Microsoft Teams step 1" /%}

1. Search for Datadog and click **Configure**.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_team_step_2_v2.6846abdd342eb1e6f753c1768a5cc1c2.png?auto=format"
      alt="Microsoft Teams step 2" /%}

1. In the connector configuration modal, copy the webhook URL.

1. In Datadog, navigate to [**Integrations > Microsoft Teams**](https://app.datadoghq.com/integrations/microsoft-teams).

1. On the Configuration tab, click **Add Handle**, give the handle a name, and paste the webhook URL.

1. In the connector configuration modal, click **Save**.

{% /tab %}

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com



## Granting additional permissions{% #granting-additional-permissions %}

Some Datadog features need permission to perform actions on your tenant, for example, creating a new channel for an incident. You need someone who is authorized to consent on behalf of the Microsoft organization to grant tenant-wide admin consent, such as a user assigned the *Global Admin* role. See [Microsoft Entra ID documentation](https://learn.microsoft.com/azure/active-directory/manage-apps/grant-admin-consent?pivots=ms-graph#prerequisites) for more information on who can grant tenant-wide admin consent to the Datadog application.

You can choose to grant Datadog both application and delegated permissions, or delegated permissions only. Using both application and delegated permissions is easy to set up, while using delegated permissions gives you more fine-grained control over the Datadog app in your tenant. For more information, see [Microsoft's Permissions and consent overview documentation](https://learn.microsoft.com/entra/identity-platform/permissions-consent-overview).

{% tab title="Using Application Permissions" %}

1. Navigate to the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams) in Datadog.
1. For the tenant in which you want to use Incident Management, click the gear icon on the right-hand side.
1. Click **Grant application permissions**, which redirects you to Microsoft. A user who can grant tenant-wide admin consent must perform this step. This user must have a Datadog account, but the email used for their Datadog account does not need to match the email for their Microsoft account.
1. Follow the prompts and click **OK**.

{% /tab %}

{% tab title="Using Delegated Permissions" %}
Delegated permissions allow Datadog to operate within your Microsoft Teams Tenant as a user. Datadog can perform any actions that that user is able to perform and access the resources that user is able to access.

First, grant the Datadog app delegated permissions:

1. Navigate to the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams) in Datadog.
1. For the tenant in which you want to use Incident Management, click the gear icon on the right-hand side.
1. Click **Grant delegated permissions**, which redirects you to Microsoft. A user who can grant tenant-wide admin consent must perform this step. This user must have a Datadog account, but the email used for their Datadog account does not need to match the email for their Microsoft account.
1. Follow the prompts and click **OK**.

Next, create the service account for Datadog to act as:

1. Create an Office365 service account user. Datadog recommends giving this service account user a name such as 'Datadog' to distinguish it from actual Microsoft Teams users and avoid confusion.

1. Assign a Microsoft Teams license to the service account.

1. Add the service account user to each team where you would like to manage incident response. This includes teams where new incident channels are created and teams from which users declare incidents.

1. Ensure that those teams have the following permissions enabled:

   - `Allow members to create and update channels`
   - `Allow members to delete and restore channels`
   - `Allow members to create, update, and remove tabs`

To enable these permissions, click **…** next to the team name > **Manage Team** > **Settings** > **Member Permissions**.

Finally, connect the service account user that you created in the first step.

1. Ensure you are logged in as the service account user you just created. **Note**: You do not need to create a Datadog user for the service account, and the service account user is not connected to the Datadog user that performs this step.
1. Navigate to the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams) in Datadog.
1. For the tenant in which you want to use Incident Management, click the gear icon on the right-hand side.
1. Click **Connect delegated user**, which redirects you to Microsoft. **Note**: You do not need to be a tenant-wide admin to perform this step.
1. Follow the prompts and click **OK**.

#### Important note about refresh tokens{% #important-note-about-refresh-tokens %}

When you connect Microsoft Teams using a delegated service account, Datadog uses a refresh token to maintain access without requiring repeated logins. This token can become invalid if the service account's password changes, the account is disabled, or Microsoft revokes the token.

These tokens also expire after 90 days. Each time Datadog performs an action on behalf of the delegated user, a new token is issued, but if the delegated user isn't used for 90 days, the token expires and the integration will stop working.

If the token becomes invalid or expires you'll need to reconnect the service account to restore functionality.

For more information see Microsoft's documentation on [refresh tokens in the Microsoft identity platform](https://learn.microsoft.com/entra/identity-platform/refresh-tokens).
{% /tab %}

### User setup{% #user-setup %}

Performing actions in Datadog from Microsoft Teams requires you to connect your Datadog and Microsoft Team accounts.

**Required permission**: To connect your accounts, your Datadog user role must include the `Integrations Manage` permission. Without this permission, you will receive an "Access Denied" error.

To connect your account from Microsoft Teams:

1. Open Microsoft Teams.

1. Start a chat with the Datadog bot by clicking on the `...` button in the vertical toolbar and selecting Datadog.

1. Type "accounts" and hit enter.

   {% image
      source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_connect_account_from_teams.55a05317b6b3b0da9d8b67c40c84e2f7.png?auto=format"
      alt="Connect accounts from Microsoft Teams" /%}

1. The Datadog bot responds with instructions on how to connect your accounts. Click **Connect Datadog Account**.

1. The Datadog bot sends another message containing a link to connect your accounts. Click the link and follow the prompts.

1. You are be redirected back to the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams).

1. Create an application key by clicking **Create** in the prompt on the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams).

You can also connect your accounts from Datadog:

1. In Datadog, navigate to the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams).
1. In the list of tenants, find your tenant and click **Connect**.
1. Follow the prompts and click **OK**.
1. From the [Microsoft Teams Integration Tile](https://app.datadoghq.com/integrations/microsoft-teams), create an application key by clicking **Create** in the prompt.

{% image
   source="https://datadog-docs.imgix.net/images/integrations/microsoft_teams/microsoft_teams_connect_account_from_datadog_v2.bf665acee53d4b408378f2ab9623aba5.png?auto=format"
   alt="Connect accounts from Datadog Microsoft Teams integration tile" /%}

If a team you have access to doesn't appear in Datadog after setup, you may need to manually sync it. See the troubleshooting information on why a team might not show up in the integration tile.

## Datadog Incident Management in Microsoft Teams{% #datadog-incident-management-in-microsoft-teams %}

The Datadog Microsoft Teams integration enables incident management directly from Teams channels and chats. You can declare new incidents, update existing ones, and list active incidents using `@Datadog` commands. The integration also supports automated incident updates channels for organization-wide visibility, automatic Teams channel creation for each incident, and one-click or automatic meeting creation with the appropriate delegated permissions. For detailed setup instructions and usage guidelines, see the [Integrate Microsoft Teams with Datadog Incident Management](https://docs.datadoghq.com/service_management/incident_management/integrations/microsoft_teams/) documentation.

The following table describes the available `@Datadog` commands:

| Category                       | Command                       | Description                                            |
| ------------------------------ | ----------------------------- | ------------------------------------------------------ |
| Global commands (run anywhere) | `@Datadog list incidents`     | Shows a list of all open incidents.                    |
| `@Datadog incident`            | Declares an incident.         |
| `@Datadog help`                | Shows all supported commands. |
| `@Datadog page`                | Triggers a page.              |
| Direct message(DM) with Bot    | `@Datadog shifts`             | Lists upcoming On-Call shifts.                         |
| `@Datadog accounts`            | Lists Datadog accounts.       |
| Channel only                   | `@Datadog sync`               | Synchronizes channels to Datadog for the current team. |


{% /callout %}

## Data collected{% #data-collected %}

### Metrics{% #metrics %}

The Microsoft Teams integration does not provide any metrics.

### Events{% #events %}

The Microsoft Teams integration does not include any events.

### Service checks{% #service-checks %}

The Microsoft Teams integration does not include any service checks.

## Permissions{% #permissions %}

The Microsoft Teams integration receives the following permissions for Teams it has been added to. For more information, see [Microsoft App permission reference](https://learn.microsoft.com/microsoftteams/app-permissions#what-can-apps-do-in-teams).

| Permission description                                                                                                                                                                    | Request Reason                                                                               |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Receive messages and data that I provide to it.                                                                                                                                           | Users can interact with the Datadog app in personal chat.                                    |
| Send me messages and notifications.                                                                                                                                                       | Users can interact with the Datadog app in personal chat.                                    |
| Access my profile information such as my name, email address, company name, and preferred language.                                                                                       | Enable users to configure Microsoft Teams notifications and workflows within the Datadog UI. |
| Receive messages and data that team or chat members provide to it in a channel or chat.                                                                                                   | Users can interact with Datadog through @Datadog commands.                                   |
| Send messages and notifications in a channel or chat.                                                                                                                                     | Send Datadog notifications to configured targets.                                            |
| Access information from this team or chat such as team or chat name, channel list, and roster (including team or chat member's names and email addresses) - and use this to contact them. | Enable users to configure Microsoft Teams notifications and workflows within Datadog.        |

{% callout %}
# Important note for users on the following Datadog sites: app.datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, app.datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com



Additional permissions are needed to use Incident Management features in the Microsoft Teams integration. These must be authorized by a user with tenant-wide permissions (see User setup for detailed instructions). For more information on these permissions, see the [Microsoft Graph permission reference](https://learn.microsoft.com/graph/permissions-reference).

{% tab title="Using Application Permissions" %}

| **API / Permissions name**                   | **Type**                  | **Request Reason**                                                                                                                                          |
| -------------------------------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Channel.Create`                             | Application and Delegated | Create channels to manage and remediate incidents using Datadog Incident Management.                                                                        |
| `Channel.Delete.All`                         | Application and Delegated | Auto Archive incident channels after a specified time period.                                                                                               |
| `ChannelMessage.Read.All`                    | Application and Delegated | Automatically sync timeline messages to the incident timeline from an incident channel.                                                                     |
| `ChannelSettings.ReadWrite.All`              | Application and Delegated | Create and modify channels to remediate incidents using Datadog Incident Management.                                                                        |
| `Directory.Read.All`,`GroupMember.Read.All`  | Application               | Provides team and channel name auto-complete suggestions for Datadog Incident Management configuration.                                                     |
| `TeamsTab.Create`                            | Application and Delegated | Create a tab in a team for the Datadog app (this permission is required for an upcoming Microsoft Teams incident declaration experience).                   |
| `OnlineMeetings.ReadWrite`                   | Delegated                 | Automatically create a meeting in a team for the Datadog app (this permission is required for an upcoming Microsoft Teams incident declaration experience). |
| `TeamsAppInstallation. ReadWriteSelfForTeam` | Delegated                 | Allow the Datadog app to check whether it's a member of a team.                                                                                             |
| `TeamsTab.Read.All`                          | Delegated                 | Check whether a Datadog tab has been created in a channel (this permission is required for an upcoming Microsoft Teams incident declaration experience).    |
| `User.Read`                                  | Delegated                 | Provide details about the signed-in user to connect a Microsoft Teams account with a corresponding Datadog account.                                         |
| `User.Read.All`                              | Delegated                 | Display the name of the Microsoft Teams user that updated or created an incident.                                                                           |
| `Team.ReadBasic.All`                         | Delegated                 | Display the teams of which the service account is a member on the incident settings page.                                                                   |

{% /tab %}

{% tab title="Using Delegated Permissions" %}

| **API / Permissions name**                   | **Type**  | **Request Reason**                                                                                                                                          |
| -------------------------------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Channel.Create`                             | Delegated | Create channels to manage and remediate incidents using Datadog Incident Management.                                                                        |
| `Channel.Delete.All`                         | Delegated | Auto Archive incident channels after a specified time period.                                                                                               |
| `ChannelMessage.Read.All`                    | Delegated | Automatically sync timeline messages to the incident timeline from an incident channel.                                                                     |
| `ChannelSettings.ReadWrite.All`              | Delegated | Create and modify channels to remediate incidents using Datadog Incident Management.                                                                        |
| `TeamsTab.Create`                            | Delegated | Create a tab in a team for the Datadog app (this permission is required for an upcoming Microsoft Teams incident declaration experience).                   |
| `OnlineMeetings.ReadWrite`                   | Delegated | Automatically create a meeting in a team for the Datadog app (this permission is required for an upcoming Microsoft Teams incident declaration experience). |
| `TeamsAppInstallation. ReadWriteSelfForTeam` | Delegated | Allow the Datadog app to check whether it's a member of a team.                                                                                             |
| `TeamsTab.Read.All`                          | Delegated | Check whether a Datadog tab has been created in a channel (this permission is required for an upcoming Microsoft Teams incident declaration experience).    |
| `User.Read`                                  | Delegated | Provide details about the signed-in user to connect a Microsoft Teams account with a corresponding Datadog account.                                         |
| `User.Read.All`                              | Delegated | Display the name of the Microsoft Teams user that updated or created an incident.                                                                           |
| `Team.ReadBasic.All`                         | Delegated | Display the teams of which the service account is a member on the incident settings page.                                                                   |

{% /tab %}


{% /callout %}

## Troubleshooting{% #troubleshooting %}

For common troubleshooting issues, see the [Troubleshooting Microsoft Teams](https://docs.datadoghq.com/integrations/guide/microsoft_teams_troubleshooting/) guide.

Need help? Contact [Datadog support](https://docs.datadoghq.com/help/).
