How to register your own Microsoft Teams Bot
Create an Azure Bot resource and get credentials to connect your bot to Tenklo
This guide shows how to register your bot using the Azure Bot resource so you can obtain a Microsoft App ID and client secret for the Microsoft Teams Bot integration in Tenklo. Your users sign in with Microsoft, and Tenklo obtains Graph and Bot Framework tokens for your bot.
Create the Azure Bot resource, which registers your bot with the Azure AI Bot Service.
- Go to the Azure portal.
- In the search box, enter Bot Services, press Enter, then click Create at the top.
- Select the Azure Bot card and select Create.
- Fill in the form: for Type of App, select Single tenant; for Creation type, use the default Create new Microsoft App ID.
- Select Review + create.
- When validation passes, select Create.
- Once deployment completes, select Go to resource. Your bot and related resources appear in the resource group you selected.
Note your Microsoft App ID (client ID)
On the Azure Bot resource’s Settings > Configuration page, find the Microsoft App ID. This is the OAuth client ID you’ll use in Tenklo. Copy it and keep it secure.
The bot tenant ID is the Azure AD tenant where your bot’s app is registered. You’ll need it for the connection config when creating a connect session (so Tenklo can generate bot tokens in connection_config).
- In the Microsoft Entra admin center, switch to the directory where you created the Azure Bot (and its app registration).
- Go to Microsoft Entra ID (or Azure Active Directory) → Overview.
- Copy the Tenant ID (Directory ID). This is your bot tenant ID; you’ll need it for the connection config later.
Create a client secret for the bot’s app registration
The bot uses an app registration in Microsoft Entra ID. You need a client secret for that app.
- From the Microsoft App ID section, click Manage Password to create a secret.
- Click New client secret, enter a description, select an expiration, and submit the form.
- Copy the Value immediately and store it securely. You won’t be able to see it again; this is your OAuth client secret for Tenklo.
So users can complete the OAuth flow in Tenklo, add Tenklo’s callback URL to the bot’s app registration.
- In the same app registration, select Authentication in the left menu.
- Under Platform configurations, click Add a platform and choose Web (if not already added).
- Add redirect URI:
https://api.tenklo.dev/oauth/callback. - Click Save.
- On the same page, open the Supported account types tab, click the dropdown, select Microsoft Entra ID tenants, choose Allow all tenants, then click Save.
Choose the permissions you want your delegated tokens to have. For example, to publish an app to the catalog and install the app on a tenant, you need the appropriate delegated permissions i.e AppCatalog.Submit and AppCatalog.ReadWrite.All. In the app registration, go to API permissions, add Microsoft Graph, choose Delegated permissions, and select the scopes you need. Configure the same scopes when setting up your integration in Tenklo.
Follow the Connect guide to set the bot host tenant ID, then the Quickstart to create your first connection.
Connection configuration
The only connection config value you need to set as a developer is botHostTenantId. This is the tenant used to request the Bot Framework token (scope https://api.botframework.com/.default). Tenklo uses it to obtain and store the Bot Framework token in connection_config. Set it when creating a connect session by passing connection_config with botHostTenantId. Example request body for POST /connect/sessions:
{
"allowed_integrations": ["microsoft-teams-bot"],
"integrations_config_defaults": {
"microsoft-teams-bot": {
"connection_config": {
"botHostTenantId": "a1b2c3d4-e5f6-47a8-9b0c-d1234567890f"
}
}
}
}To use bot operations in the end user’s tenant, the bot must be installed in that tenant. You can use a Tenklo post-connection event handler to run publish and install operations for the bot using your delegated permissions. After that, use the botFrameworkAccessToken from the connection config to perform operations on the end user’s tenant.
Documentation
For Microsoft’s official guidance on registering a bot: