Question about the timing of service principal creation for a Teams bot

石川 敦己 235 Reputation points
2025-01-27T12:42:12.81+00:00

When creating a bot resource from the Teams Developer Portal, a corresponding Microsoft Entra ID application with the same application ID as the bot is also created.

For a typical multi-tenant Microsoft Entra application, a service principal is created in an external tenant when a user from that tenant first accesses the application.

Reference: Understand user and admin consent and make appropriate code changes

Question: For a Teams bot published to the store, when is the service principal for the bot resource (Microsoft Entra application) created? Is it at the timing when a user installs the Teams app in Teams?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,824 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,544 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,145 questions
{count} votes

Accepted answer
  1. Prasad-MSFT 8,416 Reputation points Microsoft Vendor
    2025-01-28T13:58:31.7233333+00:00

    石川 敦己,
    1.PFB the documentation where it is mentioned that, when a user from a different tenant signs in to the application for the first time, Microsoft Entra ID asks them to consent to the permissions requested by the application. If they consent, then a representation of the application called a service principal is created in the user’s tenant, and sign-in can continue.

    https://learn.microsoft.com/en-us/entra/identity-platform/howto-convert-app-to-be-multi-tenant#understand-user-and-admin-consent-and-make-appropriate-code-changes

    2.Considering you plan to create a one-way bot that sends proactive messages and does not host a web server for interactive communication:

    • Proactive Messaging Feasibility: The service principal will still be created at the time of installation without any issues. Proactive messaging is supported as long as the bot has the necessary permissions to send messages to users or channels.
    • No Web Server Requirement: Hosting a web server for interactive communication is not mandatory for sending proactive messages.

    Thanks, 

    Prasad Das

    ************************************************************************* 

    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.