Hi @Arnav Gupta,
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!
Despite the fact that the BOT_ID and BOT_PASSWORD were configured as Azure App Service environment variables, the bot couldn't obtain the access_token. Moving into a multitenant configuration helped resolve this issue, but there is some confusion because the "Bot Type" section in the Azure portal appears empty when it correctly works. That's not typical behavior, and it should certainly be explained in documentation.
After switching to multitenant, the bot was able to read from Teams but when attempting to send a message, it threw an "Unauthorized" exception. Getting the appropriate permissions and proper identity configuration in place for the Azure Bot Service and managed identities typically resolves this. You sometimes need to verify the messaging endpoint is properly configured in the bot registration too.
Even if BOT_ID and BOT_PASSWORD were configured in the env files for deployment, the Azure Bot Service required them to be explicitly included in the App Service's environment variables. This is a known quirk. The best practice is always to include environment variables directly in the Azure App Service configuration so that deployment packaging problems are not encountered.
https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal
https://learn.microsoft.com/en-us/azure/bot-service/bot-service-quickstart-registration?view=azure-bot-service-4.0&tabs=userassigned
https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/authentication/bot-sso-overview
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.