Getting Keyerror, access_token while running teams bot using teams-ai library, hosted using Azure App Service

Arnav Gupta 0 Reputation points
2025-02-21T07:16:44.3966667+00:00

Used the teams-ai library's mathbot sample, used inbuilt teams toolkit provision and deploy pipelines.

App works well on local machine. Upon hosting on azure, gets this error in logs.

User's image

Getting a keyerror on access_token. However the BOT_ID and BOT_PASSWORD are configured normally in the Azure App environment variables. Moreover, the ID and password are correct, as I have ran a curl command manually and am receiving the access_token.

The app is set to be single tenant on both Azure and the Entra admin center with the correct tenant-ID.

App service and openai service have both been given user managed identities with contributor role assignments.

Does the mathbot sample have an inherent issue? Or do I need to configure something else on Azure?

Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
248 questions
{count} votes

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.