I'm encountering a 401 Unauthorized error when attempting to send a response back to a Microsoft Teams chat from my bot.
In my setup, I’m manually sending the response using a token generated via a Service Principal (SPN), which has been assigned the Azure Bot Contributor role in the IAM of the Azure Bot resource.
Due to company policy, I cannot use the Microsoft App ID and password (client secret) for authentication. Instead, I’m relying on the SPN to act on behalf of the Bot Service.
Despite the role assignment, the token doesn’t seem to be authorized to post messages to Teams. Has anyone faced a similar issue or know what specific permissions or configurations might be missing?