Skip to main content

How to Register a Bot in the Teams Developer Portal

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

Before Teams will talk to your bot, the bot needs a registration: an ID, the address Teams sends messages to, and a secret your code uses to prove it's that bot. The Teams Developer Portal creates all three in a few clicks, and it doesn't need an Azure subscription.

Microsoft calls this a Teams-managed registration. The other kind, Azure-managed, is an Azure Bot resource in an Azure subscription. Microsoft's guidance: The recommended approach to agent development is to use a Teams-managed ACS registration and migrate to an Azure-managed registration only if needed. (ACS is the Agent Communication Service, which carries messages between Teams and your bot.) The main reason to move is single sign-on: Teams-managed registrations do not support the configuration needed to enable SSO and OAuth.

Behind the scenes, the portal also creates a Microsoft Entra app registration for the bot in your organization. The bot's ID is that app's ID.

The Example​

The bot is called Echo Bot. Its code runs on my computer on port 3978, at the path /api/messages, and a dev tunnel gives it the public address https://q856tzrv-3978.inc1.devtunnels.ms.

Prerequisites​

  • A Microsoft 365 work or school account that can register apps. The portal creates the app registration with your account. If your organization has turned off app registration for users, an admin has to give you the Application Developer role first.
  • A public HTTPS address for your bot's code. Teams sends messages over the internet, so localhost isn't enough.

Step 1: Open Bot Management​

Sign in to the Teams Developer Portal, select Tools in the left menu, then Bot management. The Teams-managed bots tab lists the bots you've registered. Select New bot:

The Developer Portal's Bot management page on the Teams-managed bots tab, with the New bot button highlighted and 2 items in the list

Step 2: Name the Bot​

Type a name and select Create:

The Create a new bot dialog with the bot name Echo Bot and the Create button highlighted

The portal creates the bot and its app registration, then opens the bot's Configure page.

If Create fails

Failed to create Microsoft Entra app: Insufficient privileges to complete the operation means your account can't register apps in your organization. Fixed: "Failed to create Microsoft Entra app: Insufficient privileges to complete the operation" shows the role an admin can give you.

Step 3: Set the Endpoint​

Configure asks how the bot receives messages and events from Teams. There are two Delivery method options:

  • Socket mode (marked New): the portal describes it as a secure outbound WebSocket connection, so you don't need a public HTTPS endpoint or a development tunnel. Use it for development only; bots published to the Teams Store must use an HTTPS endpoint.
  • HTTPS endpoint: Teams sends activities to a public HTTPS endpoint. You can use a development tunnel for local development.

Choose HTTPS endpoint, enter your bot's public address followed by its message path, and select Save:

The Echo Bot's Configure page: Delivery method HTTPS endpoint selected, the endpoint https://q856tzrv-3978.inc1.devtunnels.ms/api/messages highlighted, and the Save button highlighted

The address must be public HTTPS, as the hint under the box says. While the code runs on your computer, a dev tunnel gives it one: see How to Create a Dev Tunnel That Keeps Its URL, so the address you save here keeps working.

Step 4: Create a Client Secret​

Your bot's code signs in with the bot's ID and a client secret. Select Client secrets in the bot's menu. A new bot has none yet, so select Create your first client secret. The portal asks Create a new client secret for your bot? The secret value will be shown only once after creation. Select Create client secret.

The value appears once:

The Client secret created dialog: Your new client secret has been created. Copy and save it now - you won't be able to see it again. The Client secret value box is hidden, with show and copy icons and a Done button

Select the copy icon and put the value straight into your app's secret store, such as .NET user secrets or your platform's equivalent. Treat it like a password: don't paste it into source code or chat. Then select Done. The list now shows the secret's first characters as a hint, and when it expires:

The Client secrets page with one current secret: the secret hint, which expires Nov 26, 2028, and an Actions menu

The secret I created on November 26, 2026 expires on November 26, 2028: two years later. Put a reminder in your calendar, because the bot stops signing in when it expires.

Step 5: Note the Bot ID​

Go back to Bot management. The Bot Id column shows each bot's ID, the same GUID as the Application (client) ID of its app registration. Your code needs three values from this guide:

ValueWhere it comes from
Bot ID (client ID)Bot management > Bot Id
Client secretStep 4
Tenant IDYour organization's Microsoft Entra tenant ID

Common Mistakes​

MistakeWhat happensDo this instead
Saving the endpoint without the pathTeams posts to the wrong address and your code never sees the messageAdd your code's path, such as /api/messages
Using a temporary dev tunnel's URLThe endpoint stops working when the tunnel restartsUse a persistent tunnel, or update the endpoint
Closing the secret dialog before copyingThe value can't be shown againCreate a new secret and delete the old one

Troubleshooting​

SymptomLikely causeFix
Failed to create Microsoft Entra app: Insufficient privileges to complete the operationYour account can't register appsAsk an admin for the Application Developer role
A colleague can't see or change the botTeams-managed bots belong to the account that created themUse that account, or an Azure-managed registration for shared management
The bot stops answering one dayThe client secret expiredCreate a new secret and update your app

FAQ​

Does this cost anything?​

No Azure subscription is involved. Microsoft's comparison lists the dependencies of a Teams-managed registration as None, while an Azure-managed one needs an active Azure subscription.

Who can manage the bot?​

Only you: A Teams-managed registration can be configured and managed only by the Microsoft 365 account used to create it. For a bot several people manage, Microsoft points to Azure-managed registrations.

Is my bot ready to use in Teams now?​

Not yet. Teams also needs an app package: a manifest that names the bot ID, plus two icons, which you upload to Teams. How to Create a Teams App Package for a Bot builds one.

Conclusion​

The Teams Developer Portal registers a bot in four steps: New bot, a name, the HTTPS endpoint your code listens on, and a client secret. You come away with the bot ID, its secret and your tenant ID, which is everything your bot's code needs to sign in.

Additional Resources​