Set up Microsoft Teams
Set up Microsoft Teams
Connect Aiden to Microsoft Teams so people can ask Aiden for help from the place they already work. After setup, your team can:
- Chat with Aiden one to one, in a group chat, or in a team channel.
- Tag @Aiden on a question or an alert and get the answer in the same conversation.
- Approve or reject actions, and answer Aiden's questions, with buttons in Teams.
This page is for the person who sets up the connection. To learn how to talk to Aiden once it is set up, see Use Aiden in Microsoft Teams.
Microsoft Teams is in early access. If you do not see Microsoft Teams in the integrations list, contact support@stackgen.com or your StackGen contact to turn it on for your workspace.
How it works
Aiden talks to Teams through a bot that you create in your own Microsoft Azure account. You own the bot, and you decide who in your company can use it.
Setup has three parts:
- In Azure: create the bot and get three values from it.
- In Aiden: paste those three values to connect.
- In Teams: add the Aiden app, then tell Aiden which chats and channels it should answer.
Plan for about 30 minutes. You do not need to write any code.
Before you start
Make sure you have the following. If one person does not have all of these rights, work with your Azure or Microsoft 365 admin.
| You need | Why |
|---|---|
| Admin or Workspace Admin role in Aiden | To connect Teams and choose which chats Aiden answers. |
| An Azure subscription where you can create resources | The bot lives in Azure. The free pricing tier is enough to start. |
| Rights to create an app registration in Microsoft Entra ID | Azure creates one for the bot, and you add a password (client secret) to it. |
| Rights to upload a custom app in Teams | The Aiden app is a custom app for your company. Your Teams admin may need to allow custom apps. |
| The Azure account and Teams in the same Microsoft company (tenant) | The bot only works for Teams users in the company that owns it. |
Keep a text file open while you work. You will copy three values from Azure and paste them into Aiden later. Delete the file when you finish, because one of the values is a password.
Step 1: Copy the messaging endpoint from Aiden
The messaging endpoint is the web address where Teams sends messages for Aiden. You need it when you create the bot.
- In Aiden, open Workspace Settings -> Connections -> Integrations.
- Click Add integration, then choose Microsoft Teams in the Messaging group.
- Find Messaging endpoint and click the copy button.
The address ends in /teams/events, for example https://your-aiden-host/teams/events. Keep this window open. You will come back to it in Step 5.
Step 2: Create the bot in Azure
-
Sign in to the Azure portal.
-
Click Create a resource, search for Azure Bot, and click Create.
-
Fill in the form:
Field What to choose Bot handle A unique name, for example aiden-teams-bot. People in Teams do not see this name.Subscription and Resource group Your subscription, and a new or existing resource group. Pricing tier Free (F0) is fine to start. Choose Standard (S1) for heavy use. Type of App Single Tenant. Creation type Create new Microsoft App ID. -
Click Review + create, then Create. Wait for the deployment to finish, then click Go to resource.
-
In the bot's menu, open Settings -> Configuration.
-
Paste the Aiden address from Step 1 into Messaging endpoint, then click Apply.
-
On the same page, copy these two values into your text file:
- Microsoft App ID
- App Tenant ID
Paste the full messaging endpoint, including /teams/events at the end. If you paste only the host name, Teams cannot reach Aiden and Aiden will never answer.
Step 3: Create a client secret
The client secret is the bot's password. Aiden uses it to prove to Microsoft that it is allowed to reply as your bot.
- On the bot's Configuration page, click Manage Password next to Microsoft App ID. This opens the bot's app registration in Microsoft Entra ID.
- Open Certificates & secrets, then click New client secret.
- Enter a description, such as
Aiden, and choose when it expires. Click Add. - Copy the Value right away and save it in your text file.
Azure shows the secret value only once. Copy the Value column, not the Secret ID column. If you lose the value, create a new secret.
Write down the expiry date. When the secret expires, Aiden stops replying in Teams until you add a new one. See Replace an expired secret.
Step 4: Turn on the Teams channel for the bot
- Go back to the Azure Bot resource.
- Open Settings -> Channels.
- Under Available channels, click Microsoft Teams.
- Accept the terms of service, keep Microsoft Teams Commercial selected (unless your company uses a government cloud), and click Apply.
Microsoft Teams now shows in the list of connected channels.
Step 5: Connect Teams in Aiden
-
Return to the Microsoft Teams window in Aiden (Workspace Settings -> Connections -> Integrations).
-
Paste the three values from your text file:
Field in Aiden Value from Azure Microsoft App ID Microsoft App ID from the bot's Configuration page App Tenant ID App Tenant ID from the bot's Configuration page Client secret value The secret Value from Step 3 -
Click Check and connect.
Aiden asks Microsoft to confirm the values before it saves them. When it works, you see a Connected badge and the tenant ID. Aiden stores the secret securely and never shows it again.
- Click Test connection. You should see Microsoft accepted the saved Teams credentials.
If Aiden shows an error, see Troubleshooting.
Step 6: Create the Aiden app for Teams
The bot now works, but people cannot find it in Teams yet. You need a Teams app that points to the bot. The easiest way to make one is the Teams Developer Portal.
Prefer help with this step? Ask your StackGen contact. StackGen can prepare the Azure bot and a ready-to-upload Teams app package with you.
Create the app
- Open the Teams Developer Portal and sign in with your work account.
- Click Apps -> New app. Enter a name that people will recognize, such as
Aiden, and click Add. - In Basic information, fill in the required fields (short and long description, developer name, website, privacy policy, and terms of use links). Click Save.
- In Branding, you can upload an icon so people can spot Aiden easily.
- Open App features and click Bot.
- Choose Enter a bot ID and paste the Microsoft App ID from Step 2.
- Under the places where people can use the bot, select Personal, Team, and Group chat.
- Click Save.
The Developer Portal also shows its own App ID in Basic information. That is the ID of the Teams app, not the bot. Always use the Microsoft App ID from Azure for the bot ID and in Aiden. Mixing them up makes Teams show Invalid bot.
Make the app available to your company
- In the Developer Portal, open Publish -> Download the app package. This saves a
.zipfile. - Open the Teams admin center and go to Teams apps -> Manage apps.
- Click Upload new app, then Upload, and choose the
.zipfile. - Make sure the app is allowed for the people who should use it. Your app setup and permission policies control this.
If you cannot open the Teams admin center, send the .zip file to your Teams admin and ask them to upload it. You can also use Publish -> Publish to your org in the Developer Portal. Your Teams admin then approves the app in Manage apps.
Step 7: Choose where Aiden answers
For safety, Aiden does not answer every chat by default. You pick each chat or channel, and you choose which app or agent answers there.
Add Aiden in Teams
Do this in Teams for each place where you want Aiden:
- Team channel: Click Apps in Teams, find your Aiden app, and click Add to a team. Choose the team and channel.
- Group chat: Open the chat, click + (or Apps) at the top of the chat, and add the Aiden app.
- Personal chat: Click Apps, find your Aiden app, and click Add or Open. Send one message, such as
Hello.
Find the chat ID
Aiden needs the ID of each chat or channel. The ID tells Aiden exactly which conversation you mean.
| Where | How to get the ID | The ID looks like |
|---|---|---|
| Team channel | Next to the channel name, click ... (More options), then Get link to channel, then Copy. | 19:abc123...@thread.tacv2 |
| Group chat | Point to any message in the chat, click ... (More options), then Copy link. | 19:abc123...@thread.v2 |
| Personal chat | Teams does not show this ID. Send Aiden one message first, then ask support@stackgen.com for the ID. If you run Aiden yourself, your platform team can find it in the Gateway log as channel_id. | a:1abc... |
The copied link has the ID inside it. For a channel, the ID is the part after /channel/. For a group chat, it is the part after /message/. Copy only up to the next /.
In the link, some characters are coded. Change them back before you paste the ID into Aiden:
%3aor%3Abecomes:%40becomes@
For example, this channel link:
https://teams.microsoft.com/l/channel/19%3aa1b2c3d4e5%40thread.tacv2/General?groupId=...
has this ID:
19:a1b2c3d4e5@thread.tacv2
Add the chat in Aiden
- In the Microsoft Teams window in Aiden, click Configure active channels.
- Click Add channel by ID.
- Choose Microsoft Teams, paste the ID, and add a display name you will recognize, such as
SRE on-call channel. Click Save. - Attach the app or agent that should answer in this chat. For example, attach Aiden for SRE to your incident channel.
In team channels and group chats, Aiden answers only when someone tags @Aiden, so it stays quiet during normal conversation. In a personal chat, every message is for Aiden, so no tag is needed.
Repeat these steps for each chat or channel. You can also attach an app or agent to several chats at once: select them in the list and click Attach apps/agents.
Step 8: Test it
- In a team channel you added, send
@Aiden hello. In a personal chat, sendhello. - Within a few seconds, Aiden adds an eyes reaction to your message. This means it received the message and started working.
- Aiden replies in the same conversation.
If Aiden does not answer, see Troubleshooting.
Now share Use Aiden in Microsoft Teams with your team.
Who can use Aiden in Teams
Aiden checks who sent each message. It answers only people whose Teams email address belongs to a member of your Aiden workspace. Anyone else gets an access denied reply, and Aiden does not act on their message.
Aiden runs each request as the person who sent it. It uses that person's role and the workspace policies, the same way it would in the Aiden web app.
To let someone use Aiden in Teams, add them to the workspace with the same email address they use in Teams.
Troubleshooting
| What you see | What to check |
|---|---|
| Check and connect says Microsoft rejected the credentials. | The three values must come from the same bot. Use the secret Value, not the Secret ID. Check that the secret has not expired. |
| An error says an ID is not valid. | Both IDs are long codes like xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Copy them again without extra spaces. |
| An error says a different Teams tenant is already connected. | This workspace is already connected to another Microsoft company. Click Disconnect first, then connect again. |
| You cannot find the Aiden app in Teams. | The app package is not uploaded yet, or your Teams policies do not allow it for you. Ask your Teams admin to check Manage apps and your app policies. |
| Teams shows Invalid bot. | The bot ID in the Developer Portal is wrong. Use the Microsoft App ID from Azure, not the Developer Portal App ID. Download and upload the updated package again. |
| Aiden does not react or reply. | 1. The Azure Messaging endpoint must end in /teams/events. 2. The Microsoft Teams channel must be on in Azure (Step 4). 3. The chat must be in Configure active channels with an app or agent attached. 4. In team channels and group chats, tag @Aiden. |
| The first message got no reply. | This is expected before you add the chat in Aiden. Add the chat ID (Step 7), then send the message again. |
| Aiden replies with access denied. | The sender is not a member of the Aiden workspace, or their Teams email is different from their Aiden email. See Who can use Aiden in Teams. |
| Aiden used to work but stopped replying. | The client secret may have expired. See Replace an expired secret. |
To check the bot on the Azure side, open the Azure Bot resource and use Test in Web Chat.
Manage the connection
Replace an expired secret
- In the Azure portal, open the bot's app registration (Configuration -> Manage Password) and create a new client secret. Copy its Value.
- In Aiden, open Microsoft Teams in Integrations and click Disconnect.
- Connect again with the same Microsoft App ID, the same App Tenant ID, and the new secret value.
- Click Test connection, then send a test message in Teams.
Set a reminder a few weeks before the new secret expires.
Disconnect Teams
Click Disconnect in the Microsoft Teams window in Aiden. Aiden removes the saved bot values and stops answering in Teams. To remove everything, also delete the Aiden app in the Teams admin center and the Azure Bot in the Azure portal.
Use one Teams company with several Aiden workspaces
You can connect the same Microsoft company to more than one Aiden workspace, for example one workspace per business unit.
- Best option: one bot per workspace. Repeat this guide for each workspace with a new Azure Bot and a new Teams app. Each bot then belongs to one workspace, and personal chats and group chats work normally.
- Shared bot: You can connect the same bot to several workspaces. Each team channel can then belong to only one workspace, so add each channel in only one workspace. With a shared bot, Aiden cannot tell which workspace a personal chat or group chat belongs to, so it does not answer them.