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

# Create the Azure bot

> Register a Microsoft Entra app, create the Azure Bot resource, enable Teams calling, and grant the Graph permissions StandIn needs.

Part 1 of the [Teams setup](/teams/overview). At the end of this page you will have a bot identity
(client ID + tenant ID + client secret) wired to StandIn's endpoints, with the Graph permissions
consented. All screenshots are from the Azure portal; the values shown are placeholders.

## 1. Register a Microsoft Entra app

In the [Azure portal](https://portal.azure.com), search for **App registrations**:

<Frame caption="The portal search finds App registrations under Services.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/search-app-registrations.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=e544822f7f1e1c008f04ac4221c658f0" alt="Azure portal search bar with App registrations typed in and the App registrations service shown in the results" width="1600" height="946" data-path="images/teams/search-app-registrations.png" />
</Frame>

Select **New registration**:

* **Name**: anything you like (users never see it; the Teams app name comes from the manifest).
* **Supported account types**: **Single tenant only** is the right choice for a bot that serves
  your own organization.
* **Redirect URI**: leave empty.

<Frame caption="App registrations > New registration: name it and keep Single tenant only.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/entra-register-app.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=e26db41a195b7a77fc432d76751471b5" alt="Register an application form in the Azure portal with a name filled in and Single tenant only selected" width="1600" height="898" data-path="images/teams/entra-register-app.png" />
</Frame>

Official reference: [Register an application with the Microsoft identity platform](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).

## 2. Record the IDs

On the app's **Overview** page, copy two values - you will need them repeatedly:

* **Application (client) ID** - this is your **`botId`** (and the `MicrosoftAppId` of the Azure Bot).
* **Directory (tenant) ID** - your tenant.

<Frame caption="The Overview page shows the Application (client) ID and Directory (tenant) ID.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/entra-app-overview.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=7dd951c1a732a3061e0f04a1ac4c652a" alt="Entra app registration overview page highlighting the client ID and tenant ID fields" width="1600" height="900" data-path="images/teams/entra-app-overview.png" />
</Frame>

## 3. Create a client secret

Under **Certificates & secrets**, select **New client secret** and copy the secret **Value**
immediately - it is shown only once. StandIn uses this credential (App ID + secret + tenant) to
authenticate as your bot; you provide it during [pairing](/quickstart#connect-your-agent-by-pairing-recommended)
or in the dashboard when registering the identity.

<Warning>
  Treat the client secret like a password: store it in a secret manager, never commit it, and set a
  reminder before its expiry date - calls stop when it lapses.
</Warning>

## 4. Create the Azure Bot resource

Search the portal for **Bot** and open **Bot Services**:

<Frame caption="The portal search: Bot Services is where Azure Bot resources live.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/search-bot-services.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=588e6c53dcbc451ef871fca926800af3" alt="Azure portal search bar with Bot typed in and the Bot Services service shown in the results" width="1600" height="318" data-path="images/teams/search-bot-services.png" />
</Frame>

Create an **Azure Bot** and fill in the basics:

* **Bot handle / subscription / resource group**: your choice.
* **Data residency**: Global is typical.
* **Pricing tier**: the free **F0** tier is fine (Standard channels like Teams are free).
* **Type of App**: **Single Tenant**, matching the app registration.

<Frame caption="Create an Azure Bot: pick a handle, subscription, and pricing tier.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/azure-bot-basics.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=ac7535a955cdeb62084ea9f9a746ae7f" alt="Create an Azure Bot basics form in the Azure portal" width="1600" height="1196" data-path="images/teams/azure-bot-basics.png" />
</Frame>

Under **Microsoft App ID**, choose **Use existing app registration** and paste the **App ID**
(client ID) and **App tenant ID** from step 2, then **Review + create**.

<Frame caption="Creation type: Use existing app registration, with the client ID and tenant ID from step 2.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/azure-bot-app-id.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=1ea21570f6da12f082bceba857d51334" alt="Create an Azure Bot form showing Use existing app registration selected with App ID and tenant ID fields" width="1600" height="1196" data-path="images/teams/azure-bot-app-id.png" />
</Frame>

Once deployment finishes, the resource's **Overview** shows the essentials - pricing tier, location,
and (after step 7) the messaging endpoint:

<Frame caption="The Azure Bot Overview page after creation.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/azure-bot-overview.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=2e2bafddd4f6b2dbca1e807a56ffe2fa" alt="Azure Bot resource overview page showing resource group, subscription, pricing tier, and messaging endpoint" width="1600" height="778" data-path="images/teams/azure-bot-overview.png" />
</Frame>

Official reference: [Create an Azure Bot resource](https://learn.microsoft.com/en-us/azure/bot-service/abs-quickstart).

## 5. Enable the Microsoft Teams channel

Open the new Azure Bot resource, go to **Settings → Channels**, and select **Microsoft Teams**.
Accept the terms and apply; the channel appears under connected channels as **Healthy**.

<Frame caption="Channels: Microsoft Teams connected and Healthy.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/bot-channels-teams.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=276bb1da780f965be1dbaf456aaf4996" alt="Azure Bot Channels page showing the Microsoft Teams channel connected with a healthy status" width="1600" height="968" data-path="images/teams/bot-channels-teams.png" />
</Frame>

Opening the channel shows three tabs - **Messaging**, **Calling**, and **Publish**. Messaging is on
by default (**Microsoft Teams Commercial** is right for most tenants); the next step configures
Calling.

<Frame caption="The Teams channel opens on the Messaging tab.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/teams-channel-messaging.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=82acb37dc56759078a942cd9f1deb877" alt="Microsoft Teams channel Messaging tab showing Microsoft Teams Commercial selected" width="1600" height="968" data-path="images/teams/teams-channel-messaging.png" />
</Frame>

## 6. Enable calling and set the webhook

Still in the Teams channel, open the **Calling** tab:

1. Check **Enable calling**.
2. Set **Webhook (for calling)** to the **calling webhook URL from your StandIn dashboard** (shown
   on your identity after you register it).
3. **Apply**.

<Frame caption="Calling tab: Enable calling, webhook from your StandIn dashboard.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/teams-channel-calling.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=7e32237feac509c09968492212ac49de" alt="Microsoft Teams channel Calling tab with Enable calling checked and the webhook field highlighted" width="1600" height="968" data-path="images/teams/teams-channel-calling.png" />
</Frame>

Official references: [Registering a calling bot](https://microsoftgraph.github.io/microsoft-graph-comms-samples/docs/articles/calls/register-calling-bot.html)
(Microsoft Graph communications samples - covers this whole page end to end) and
[Register a calling bot for Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/calls-and-meetings/registering-calling-bot).

## 7. Set the messaging endpoint (optional, for chat)

Voice works without this step. If you also want **Teams chat**, go to **Settings → Configuration**
and set **Messaging endpoint** to the URL from your StandIn dashboard.

<Frame caption="Configuration: the messaging endpoint powers Teams chat.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/azure-bot-messaging-endpoint.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=cb9e26d9aa6678cc82a84e593eb32abf" alt="Azure Bot Configuration page with the messaging endpoint field highlighted" width="1600" height="968" data-path="images/teams/azure-bot-messaging-endpoint.png" />
</Frame>

<Note>
  Chat only works after you also set your **Agent chat URL** in the StandIn dashboard - the
  `https://` URL where your agent serves Bot Framework chat messages, e.g.
  `https://<your-public-host>/api/messages` (paste the bare host and StandIn appends `/api/messages`
  for you). Until then, chat messages get a "chat endpoint not configured" reply.
</Note>

## 8. Grant Graph permissions

Back on the **app registration** (the same Entra app as `botId`): **API permissions → Add a
permission → Microsoft Graph → Application permissions**, add the list below, then select
**Grant admin consent** for your tenant (requires an admin).

<Frame caption="API permissions > Add a permission > Microsoft Graph.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/graph-add-permission.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=c8f0cc2c02ef0eef60475e4db69580d8" alt="Azure portal API permissions blade with Add a permission opening the Microsoft Graph API panel" width="2966" height="487" data-path="images/teams/graph-add-permission.png" />
</Frame>

This is the canonical list - it applies to all six bridges and plugins:

<table>
  <thead>
    <tr>
      <th style={{ minWidth: "18rem" }}>Permission</th>
      <th>Purpose</th>
    </tr>
  </thead>

  <tbody>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Calls.JoinGroupCall.All`</td><td>answer / join Teams calls and meetings</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Calls.JoinGroupCallAsGuest.All`</td><td>join meetings as a guest participant</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Calls.AccessMedia.All`</td><td>access real-time Teams call audio/video media</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Calls.Initiate.All`</td><td>outbound 1:1 "call me back" (skip if unused)</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Calls.InitiateGroupCall.All`</td><td>outbound group "call me back" (skip if unused)</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Chat.Read.All`</td><td>resolve chat / thread ids and read message context</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`ChatMessage.Read.Chat`</td><td>read messages in chats the bot is installed in</td></tr>
    <tr><td style={{ whiteSpace: "nowrap" }}>`Sites.ReadWrite.All`</td><td>upload files / minutes to SharePoint (OneDrive) for chat attachments (optional)</td></tr>
  </tbody>
</table>

After consent, every row shows a green **Granted** status:

<Frame caption="Configured permissions with admin consent granted for the calling permissions.">
  <img src="https://mintcdn.com/komaa/pa0qxKzF_T-m0SMe/images/teams/api-permissions-granted.png?fit=max&auto=format&n=pa0qxKzF_T-m0SMe&q=85&s=324f78dba5dbdd8b504f7d50d43839a4" alt="API permissions page listing the Calls application permissions, each with a green Granted status" width="1600" height="968" data-path="images/teams/api-permissions-granted.png" />
</Frame>

Official references: [Registering a calling bot](https://microsoftgraph.github.io/microsoft-graph-comms-samples/docs/articles/calls/register-calling-bot.html)
(lists the `Calls.*` permissions), [Grant tenant-wide admin consent](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent),
and the [cloud communications API overview](https://learn.microsoft.com/en-us/graph/cloud-communications-get-started).

## Checkpoint

You should now have:

* [x] **Client ID** (`botId`), **tenant ID**, and a **client secret**
* [x] An **Azure Bot** with the **Teams channel** enabled
* [x] **Calling enabled** and the webhook pointed at StandIn
* [x] (Optional) **Messaging endpoint** set for chat
* [x] Graph permissions **admin-consented**

Next: [Get the Teams app package](/teams/app-package).
