Setup guide · Microsoft Teams
Connect Microsoft Teams with your own Azure Bot: step by step
The bot lives in your own Azure subscription and Microsoft tenant, so your organisation owns it and its secret. It takes about twenty minutes and needs an Azure admin who can create resources and app registrations, a Teams admin who can upload apps, and an AhlanHamad admin with settings access — one person can be all three. Every label below is the one you will see on screen.
Updated 12 October 2026
1. Before you start
- Teams approvals are switched on per company. If you do not see Integrations → Microsoft Teams in AhlanHamad, ask us to switch it on.
- You need an Azure subscription in the same Microsoft tenant as your Teams users. The Azure Bot resource itself can use the free (F0) pricing tier.
- Since 31 July 2025 Azure creates only single-tenant (or managed-identity) bots (Microsoft Learn). A single-tenant bot in your own tenant is exactly what this setup uses.
2. In AhlanHamad: get your messaging endpoint
- Go to Integrations → Microsoft Teams and click Start setup.
- Copy Your messaging endpoint. It is unique to your company.
The endpoint only tells AhlanHamad which company a message is for. Every message must still carry a token Microsoft signed for your bot's App ID, and must come from your tenant, before anything happens.
3. In Azure: create the bot
- In the Azure portal, choose Create a resource, search for Azure Bot and click Create.
- Enter a bot handle, subscription and resource group. Under Type of App choose Single Tenant; under Creation type choose Create new Microsoft App ID. Click Review + create, then Create.
- Open the new resource and go to Settings → Configuration. Paste your messaging endpoint into Messaging endpoint and click Apply.
- On the same page copy the Microsoft App ID and the App Tenant ID.
- Next to the Microsoft App ID click Manage Password. Under Client secrets click New client secret, choose an expiry, click Add, and copy the Value right away — Azure shows it once.
- Go to Settings → Channels, choose Microsoft Teams, accept the terms and click Apply (Microsoft Learn).
4. In AhlanHamad: connect your bot
- Back in Integrations → Microsoft Teams, paste the Microsoft App ID (bot ID), the App Tenant ID (directory ID) and the Client secret value.
- Click Connect my bot. AhlanHamad asks Microsoft for a token with these values before saving them, so a typo is caught here.
5. In Teams: upload the app for your organisation
- In AhlanHamad click Download Teams app package. The .zip carries your bot's ID, the icons and the Arabic strings.
- In the Teams admin center, go to Teams apps → Manage apps and click Upload new app (Microsoft Learn).
- So approvers receive cards without installing anything, add the app to a Setup policy (Teams apps → Setup policies → Installed apps) for the people who approve requests (Microsoft Learn).
Members are then matched to employees by their Microsoft sign-in name on a domain you confirm, the same as before. You can change any match in the members table.
How your credentials are kept
- The client secret is stored encrypted and never shown again, not even to admins. The App ID and Tenant ID are not secrets.
- Every message is checked as Microsoft documents: a token signed by the Bot Framework for your bot's App ID, inside its validity window, for the Teams channel (Microsoft Learn). A message from any other tenant is ignored.
- Replies are sent with a token AhlanHamad requests from your own tenant with your bot's credentials.
- A Microsoft tenant can be connected to one AhlanHamad company only.
6. Troubleshooting
| Message | What to do |
|---|---|
| The Microsoft App ID is a GUID like 1a2b3c4d-…. Copy it from the bot's Configuration page. | Copy Microsoft App ID from Settings → Configuration, not the bot handle. |
| Paste the client secret's Value (not its Secret ID). | Create a new client secret and copy its Value column. |
| Microsoft did not accept these values. Check that the App ID, the Tenant ID and the secret belong to the same bot and that the secret has not expired. | Check the three values on the bot's Configuration page; if the secret's value is lost, create a new one. |
| This Microsoft tenant is already connected to another Ahlan Hamad company. | Disconnect it from the other company first, or contact us. |
When the client secret expires in Azure, cards stop arriving. Create a new secret and paste it under Your bot's endpoint, credentials and app package → Save new credentials.
7. Disconnecting
- In AhlanHamad, click Disconnect Microsoft Teams. The stored client secret is deleted and your endpoint stops acting on messages.
- In Azure, delete the client secret (or the whole Azure Bot resource), and remove the app in the Teams admin center if you no longer need it.
Microsoft sources used in this guide
- Create an Azure Bot resource
- Connect a bot to Microsoft Teams
- Authenticate requests with the Bot Connector API
- Upload custom apps in the Teams admin center
- App setup policies in Teams
- Microsoft, Azure and Teams are trademarks of Microsoft. AhlanHamad is not affiliated with Microsoft.