# MS Teams ChatBot Installation

This document provides a complete, user-friendly guide for creating a webhook-triggered Autom in Autom Mate and connecting it to a ChatBot inside Microsoft Teams.

***

## **1. Preparing the Webhook in Autom Mate**

1. Create a new **Autom** in Autom Mate.
2. Set the Autom's **Trigger Method** to **Webhook**.
3. Copy and save the generated **Webhook URL** — it will be required in later steps.

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2Fcn3xOAUmXJELzNysNRTY%2Fimage.png?alt=media&#x26;token=29a9bebb-00d6-448a-8b2b-b0c98bf3c065" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
You can find a sample webhook URL below. This example illustrates the format, and note that each webhook is uniquely generated for each Autom:

```
https://qa.betaautommate.com/api/v1/automs/run/9cec7314-6a41-4220-bff5-c41001261d20?apiKey=TQWDK9H-MZMM5X2-G1PRWJ6-B7Y4G69
```

As you may have observed, the webhook URL includes an API Key at the end. If your webhook does not contain an API Key, it will not function. To properly configure your webhook, navigate to the help section (indicated with a “?” at the bottom of the left panel) and select the **Create API Key** tab. If you do not already have an API Key, please generate one before proceeding.
{% endhint %}

***

## **2. Creating the Azure Bot Service**

### **2.1 Login to Azure Portal**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FiwvaJZbz937KJ1jkbsHR%2Fimage.png?alt=media&#x26;token=c14d3d4d-fece-4d25-b5b2-b38869ffd3ae" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FUar0yJTjh40HpQlcRTqf%2Fimage.png?alt=media&#x26;token=41c1c5b8-dd46-495b-8742-7620f6769218" alt=""><figcaption></figcaption></figure>

4. Go to <https://portal.azure.com> and sign in.
5. Click **Create a Resource**.
6. Search for **Azure Bot Service**, select it, and click **Create**.

### **2.2 Bot Basic Setup**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2F72EvfVV2BKqyHtHb1PGB%2Fimage.png?alt=media&#x26;token=64c99f05-a82d-46b8-8fc4-7cb77367eab1" alt=""><figcaption></figcaption></figure>

7. Fill in the required fields:
   * **Bot Name**
   * **Subscription**
   * **Resource Group**
8. In **Pricing Tier**, you can select one of them. We continued with Free Plan.
9. In **Type of App**, choose **Single Tenant**.

### **2.3 Create Microsoft App ID**

10. Select **Create new Microsoft App ID**.
11. Proceed with **Review + Create → Create** to complete the bot setup.

***

## **3. Configuring Bot Channels**

12. Once the bot is created, click **Go to Resource**.
13. From the left menu, navigate to **Channels**.
14. Under *Available Channels*, find **Microsoft Teams** and open it.
15. Save without making any changes. After saving it should be appeared like below.

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FaFBn10rI6CaX7C7NT4qJ%2Fimage.png?alt=media&#x26;token=dbb139a0-806a-4333-86df-b91d35b0351a" alt=""><figcaption></figcaption></figure>

***

## **4. Messaging Endpoint & Identity Information**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2Fv7XjpsmYOWTrmQ76L8lM%2Fimage.png?alt=media&#x26;token=9ccae7f1-7e8d-4651-a485-9af2c820059d" alt=""><figcaption></figcaption></figure>

### **4.1 Connecting Webhook as Messaging Endpoint**

16. Go to the **Configuration** section.
17. In the **Messaging Endpoint** field, paste the webhook URL you created in Autom Mate. And then click to "Apply" button. Please be careful to apply, sometimes you need to click double to make sure it saved.

### **4.2 Saving Identity Information**

18. On the same page, copy the following for Autom Mate Vault:

* **Microsoft App ID**
* **Tenant ID**

### **4.3 Creating a Client Secret**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FZ4unBzd85jgW5m74Hk3X%2Fimage.png?alt=media&#x26;token=f8736a37-56ba-4fe8-a4de-d7e267d009e0" alt=""><figcaption></figcaption></figure>

19. Click **Manage Password** on the Configuration page.
20. In **Certificates & Secrets**, create a **New Client Secret**.
21. Save the **Secret Value** for later use in the Autom Mate Vault.

***

## **5. Adjusting App Registration Settings**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FiXVjAMni4IKTDzajqhLf%2Fimage.png?alt=media&#x26;token=67792f2e-cb38-4daa-90ee-5f53c95ea6f7" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FsnRCA6nkAz5y9ZwTqIiu%2Fimage.png?alt=media&#x26;token=d2dd0531-25bc-4f4c-90e4-332e0efd46e8" alt=""><figcaption></figcaption></figure>

22. In Azure Portal, open **App Registrations**.
23. Find your bot application under **All Applications** and open it.
24. Go to the **Authentication** menu. Select **Supported Accounts.**
25. Change the supported account type **Multiple Entra ID tenants** and choose **Allow all tenants.** Save the page.

***

## **6. Defining the Application in Teams Developer Portal**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FSWhGlSTEcoBPkGQUpHwp%2Fimage.png?alt=media&#x26;token=58923ff9-da62-46cf-a5bf-d72adeed58be" alt=""><figcaption></figcaption></figure>

26. Go to <https://dev.teams.microsoft.com> (Developer Portal).
27. Click **Create a New App** to create a Teams app container.

### **6.1 Filling in Basic Information**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FkVItvZCeKBuueC96iIwE%2Fimage.png?alt=media&#x26;token=4fa4b8bd-574a-4f7b-bbcd-14deb36a8d2b" alt=""><figcaption></figcaption></figure>

28. From the left menu, open **Configure → Basic Information**.
29. The following **mandatory fields** must be completed:

| **Category**              | **Field**                | **Requirement**                                         | **Mandatory**            |
| ------------------------- | ------------------------ | ------------------------------------------------------- | ------------------------ |
| **App Names**             | Short Name               | Must be 30 characters or fewer                          | **Yes**                  |
| **Descriptions**          | Short Description        | Max 80 characters; must differ from long description    | **Yes (for submission)** |
| **Descriptions**          | Long Description         | Max 4000 characters; must differ from short description | **Yes (for submission)** |
| **Developer Information** | Developer / Company Name | Full developer or organization name                     | **Yes**                  |
| **Website**               | Website URL              | Must be a valid HTTPS URL                               | **Yes**                  |
| **App URLs**              | Privacy Policy URL       | Valid link to the privacy policy                        | **Yes**                  |
| **App URLs**              | Terms of Use URL         | Valid link to the terms of use                          | **Yes**                  |

After completing these mandatory items, you may fill in optional metadata fields if needed.

***

## **7. Setting Required Permissions**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2Fro0pgNdFM6MsBJUDmx5b%2Fimage.png?alt=media&#x26;token=460f281e-1c47-4b36-b762-1f8f748a2874" alt=""><figcaption></figcaption></figure>

30. Go to the **Permissions** menu.
31. Expand **Teams Permissions → Application**.
32. Enable the following permissions:
    1. **Teams / Application Permissions:**

       1. `ChannelMessage.Read.Group`
       2. `ChannelMessage.Send.Group`

       <figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FIdQFqI74DV3lM3qOvgLO%2Fimage.png?alt=media&#x26;token=4d604deb-ecea-4174-9056-07849ea41157" alt=""><figcaption></figcaption></figure>
    2. **Chat / Application Permissions:**

       1. `ChatMessage.Read.Chat`
       2. `ChatMessage.Send.Chat`

       <figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FM1dRiFt21CygqmxEXR1t%2Fimage.png?alt=media&#x26;token=f5775459-98e0-4ab6-89b1-333e6f984058" alt=""><figcaption></figcaption></figure>
33. Save your changes.

***

## **8. Linking the Bot to the Application**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2Fkl6xcYJCXqHKbgaYQBkw%2Fimage.png?alt=media&#x26;token=0098f615-45b4-45a1-abaa-6a4906cad39d" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FIH2q5Hfs7znAPzj5PZXz%2Fimage.png?alt=media&#x26;token=e5e03136-999d-41dd-9ef8-472248cb413b" alt=""><figcaption></figcaption></figure>

34. Open **App Features** from the left menu.
35. Select **Bot**.
36. Enter your **Microsoft App ID** into the Bot ID field.
37. Under "Scopes," enable all three options:
    1. Personal
    2. Team
    3. Group Chat
38. Save.

***

## **9. Packaging and Validation**

39. Click the **Distribute** button.
40. Select **Download App Package** to download the Teams app package. We will use this package after.

### **9.1 Validation Process**

<div data-full-width="false"><figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FGSqa9IVtz4MTw321rQc2%2Fimage.png?alt=media&#x26;token=b1758752-4646-4811-81fc-3bbdb881cc44" alt=""><figcaption></figcaption></figure></div>

41. Open the **App Validation** section in the Developer Portal.
42. The interface will automatically display validation results for your bot.
43. You may see **4 validation warnings** — these are non-critical and **can be safely ignored**, as they do not affect deployment.

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FM7WfBxHVmVJhQiKSBolU%2Fimage.png?alt=media&#x26;token=658b15c0-455a-4a83-9832-17f7fd068c2a" alt=""><figcaption></figcaption></figure>

> Note: The new interface does **not** require uploading the package for validation.

***

## **10. Publishing via Microsoft Teams Admin Center**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2F1udxmpOdmyw612dO8Fi9%2Fimage.png?alt=media&#x26;token=3073d965-64cc-432e-b3be-8f76e1462039" alt=""><figcaption></figcaption></figure>

44. Go to <https://admin.teams.microsoft.com>
45. Navigate to **Teams Apps → Manage Apps**.
46. Click **Upload New App**.
47. Upload the Teams app package downloaded from the Developer Portal.

{% hint style="info" %}
⏳ It may take up to **5 minutes** for the bot to appear inside MS Teams. You can also test instantly using the **Preview in Teams** button inside Developer Portal.
{% endhint %}

***

## **11. Creating Credentials in Autom Mate**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2Fal6iSXSXOiazedhhTP1P%2Fmsedge_3BQD6nuN7c.png?alt=media&#x26;token=d3045f4e-50ca-4750-b6f5-74ac2a22a237" alt=""><figcaption></figcaption></figure>

You should now have:

* **Tenant ID**
* **App ID**
* **Client Secret**

48. Create a **Credential Profile** in Autom Mate Vault using these values.
49. After that, turn back to the Autom that we created and saved the webhook. Add a Send Message action inside an Autom from MS Teams Library.
50. Select the Teams credential that you created.
51. Type **"Hello"** into the message field and execute the Autom. Your Teams bot will now respond with **"Hello World!". You can find the example Autom at below; you can download it and then configure credentials. After that you can use this, Autom. Do not forget the set trigger type as webhook.**

<figure><img src="https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FJ1a8eBLzRQNiKVPjrsju%2Fms-teams_m28csmsuAO.png?alt=media&#x26;token=b844d08a-2de1-4be8-92ae-73969953d38d" alt=""><figcaption></figcaption></figure>

**Here is the example Autom that you can download to test.**

{% file src="<https://4222414448-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMAf5diEa8kgXDA6h47Cu%2Fuploads%2FsFMXtaGjg9Y4zeCrPtSA%2FMS%20Teams%20Bot%20Test.json?alt=media&token=1e300d13-6f98-4ffd-b99e-322435e3820b>" %}
