Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Thank you for posting your question in the Microsoft Q&A forum.
As far as I know, the Microsoft Graph API endpoints used to send messages to a Teams chat or channel currently support only delegated permissions, which require a user context (user login / user token). Application permissions (app‑only / Service Principal) are not supported for sending normal chat or channel messages. App‑only permissions are only allowed for importing messages during migration scenarios, not for sending live messages.
Because of this, it is unfortunately not possible to configure a Service Principal (app‑only identity) to send messages in the way you described.
At the moment, the only valid approach to send messages into a Teams chat or channel without relying on a user’s identity is to use a Bot application (Azure Bot / Bot Framework). However, the bot must be added to the chat or channel before it can send any messages there.
Reference: https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http
I hope this clarifies the current limitations and helps you move forward.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.