# MS Teams Integration

By integrating Teams, the process of managing Alerts in clusters becomes more efficient. This feature enables users to promptly receive notifications on the designated Teams channel whenever alerts are produced.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FSDkpX72i2a9FR8hLIJfN%2FGroup%204995.png?alt=media&#x26;token=8c2cfc35-0d01-467f-90fc-6b34c37be291" alt=""><figcaption><p>MS Teams profile</p></figcaption></figure>

## Configuring Teams integration with the profile

### :tools: **How to create Teams Profile**

There are two options for creating a Profile: [from the Settings tab](#from-the-settings-tab) or directly from the Overview.

#### From the **Settings** tab

Go to the **`Settings`** tab on the left panel -> select **`Integrations`** -> click the **`+Add Integration`** button and select **`Teams`** from the drop-down -> insert [teams\_webhook](https://docs.perfectscale.io/customize-workflow/communication-and-messaging/ms-teams-integration/how-to-configure-teams_webhook) -> click **`Save`** button.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FpskyTTbjRFtIwtgdMkJb%2FDAPTAVVHhU.gif?alt=media&#x26;token=369e2e5e-1889-4500-9e2a-404c9b438ebe" alt=""><figcaption><p>MS Teams profile from settings</p></figcaption></figure>

#### From the **Overview** tab

Go to the **`Overview`** tab on the left panel -> find the cluster to which you want to apply the **`Profile`** and click **`gear`** button -> go to **`Customizations`** -> find **`Integrations`** and click the **`Communication & Messaging`** drop-down list -> click the **`Add New Profile`** button and select **`Teams`** -> insert [teams\_webhook](https://docs.perfectscale.io/customize-workflow/communication-and-messaging/ms-teams-integration/how-to-configure-teams_webhook) -> click **`Save And Apply`** button.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2Fc4e0F0aIZi3LgDXg2PpG%2FfObC7i6bmK.gif?alt=media&#x26;token=9a5a79d3-1554-4801-b6a4-8023003d8feb" alt=""><figcaption><p>MS Teams profile from overview</p></figcaption></figure>

### :tools: **How to apply** Teams **Profile**

#### Apply to a single cluster

To apply **`Teams Profile`** to the cluster, go to the **`Overview`** tab on the left panel -> find the cluster to which you want to apply the **`Teams Profile`** and click **`gear`** button -> go to **`Customizations`** -> select the needed profile in the **`Communication & Messaging`** drop-down list.&#x20;

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FS7LQmx0NoUDEWOjiXxaG%2FEc86vy6fvt.gif?alt=media&#x26;token=bc6e0487-e985-4cb8-8dba-eefbd08785ed" alt=""><figcaption><p>Applying MS Teams profile to a single cluster</p></figcaption></figure>

#### Apply to multiple clusters

To apply the profile to **multiple clusters** from a single view, use the **`Manage Assignments`** feature.&#x20;

Go to the **`Settings`** tab on the left panel -> select the **`Integrations`** -> click the **`Manage Assignments`** button -> go to **`Communication & Messaging`** section and apply the profiles for the needed clusters -> click the **`Save Changes`** button.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FW9CdlcCYGkpgOoz02jU2%2FOWAIGY193i.gif?alt=media&#x26;token=f192d3a0-35ef-4e7a-931b-e5632e5f6d0d" alt=""><figcaption><p>Applying MS Teams profile to multiple clusters</p></figcaption></figure>

## Configuring Teams integration with CRD

To enable Teams alerts using a Custom Resource Definition (CRD), you’ll need to define and apply a Custom Resource (CR) with the required parameters. This approach allows you to manage Teams alerting directly through Kubernetes manifests.&#x20;

{% hint style="warning" %}
The Custom Resource (CR) must be created in the `perfectscale` namespace.
{% endhint %}

### Setup instructions

1. Go to the **Apps** at <https://teams.microsoft.com/>.
2. Go to **Incoming Webhook** and click **Add** to connect your Webhook to a specific channel.
3. Provide the channel name where you want PerfectScale alerts to be received.
4. Name your webhook and click the **Create** button.
5. Copy the webhook URL (you will need it for the **Teams webhook secret** in the next steps).

Apply the **Teams webhook secret** first:

```yaml
apiVersion: v1
kind: Secret
metadata:
  name: teams-credentials
  namespace: perfectscale
type: Opaque
stringData:
  webhook-url: "https://outlook.office.com/webhook/your-webhook-url-here"
```

{% hint style="info" %}
Ensure that the secret is created in the same namespace as the exporter -  `perfectscale`.
{% endhint %}

Configure the CR:

```yaml
apiVersion: perfectscale.io/v1
kind: ClusterSettings
metadata:
  name: cluster-settings-main
  namespace: perfectscale
spec:
  profiles:
    integrations:
      - type: teams
        name: ops-team-notifications
        assigned: true
        value:
          teams_webhook_from:
            secretKeyRef:
              name: teams-credentials
              key: webhook-url
```

⚙️ **CR parameters:**

<table><thead><tr><th width="251.94921875">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><strong><code>teams_webhook_from</code></strong></td><td>A secret that permits PerfectScale to interact with your Teams. Learn how to configure <a href="ms-teams-integration/how-to-configure-teams_webhook">teams_webhook here</a>.</td></tr></tbody></table>

## Teams Integration Verification

To verify the accuracy of your MS Teams configuration, simply click on the **`Test Integration`** button. When the configuration is correct, you will see the message **`Teams Configured Correctly`**. In case of **`Teams Configured Wrongly`** response, check and ensure that the  [`teams_webhook`](https://docs.perfectscale.io/customize-workflow/communication-and-messaging/ms-teams-integration/how-to-configure-teams_webhook) URL is correct.

<figure><img src="https://1573387604-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FABMqnYtsOO44JmQTVSnn%2Fuploads%2FnA5kyidZXMyOKInJyxay%2Fteams%20test.gif?alt=media&#x26;token=852a0241-2f55-4f8c-be29-1abe79493123" alt=""><figcaption><p>MS Teams integrations verification</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.perfectscale.io/customize-workflow/communication-and-messaging/ms-teams-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
