microsoft / teams-ai

SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels
MIT License
391 stars 169 forks source link

[Bug]: Bot becomes unresponsive after deployment to Azure App Service #1837

Closed aligg73 closed 3 weeks ago

aligg73 commented 1 month ago

Language

Javascript/Typescript

Version

latest

Description

I am experiencing issues with my bot developed using Teams-AI and the Team-AI toolkit in VS Code. The bot used to work perfectly, and it still functions correctly when tested locally using the testtool. However, after deploying the bot to the development or production environment on Azure App Service, the bot becomes unresponsive when accessed via web chat (in Azure) or directly from Teams.

Error Messages:

In web chat, I receive the following error: HTTP status code ServiceUnavailable. Previously, I encountered the following error: HTTP status code GatewayTimeout in web chat.

As mentioned, the bot's functionality is intact and performs well in the local environment. The issue arises only after deploying the bot to the Azure App Service (both in dev and prod environments). I have enabled diagnostic logging and reviewed the application insights, but the root cause of the issue is not clear.

Steps Taken to Debug:

Verified the instrumentation key and environment variables. Enabled diagnostic logging and reviewed the logs in the Azure portal. Checked the configuration and permissions of the web.config file. Ensured that all required modules and features are installed and correctly configured.

I have also tried to remove all the resources in the resource group and deploying it again, but I stumble upon the same issue.

This issue is annoying and there doesn't seem to be a single place from where we can easily debug the issue. The amount of settings, env files and localConfigs are confusing and not helping us develop AI solutions on top of Teams.

Thanks for your guidance.

Reproduction Steps

1. Provision the app in dev
2. Deploy the app in ev
3. Publish the teams app and try from Web Chat or MS Teams directly
corinagum commented 1 month ago

@aligg73 which sample(s) are you using as your base to deploy from?

aacebo commented 1 month ago

this may be due to the issue we found with the peer dependency version that we fixed here https://github.com/microsoft/teams-ai/pull/1855, please try again and let us know if the problem persists.

aligg73 commented 1 month ago

I am testing but now I am getting other (legacy OpenAI) errors, should the config.json types change from 'completion' to 'chat'? Would be good to know exactly what needs to be updated, because I saw the config.json of samples in the main branch still use 'completion'.

corinagum commented 1 month ago

I am testing but now I am getting other (legacy OpenAI) errors, should the config.json types change from 'completion' to 'chat'? Would be good to know exactly what needs to be updated, because I saw the config.json of samples in the main branch still use 'completion'.

@aligg73 Yes, please update to use 'chat'. That's an update we overlooked that we need to make to the samples. Can you confirm if you're still getting OpenAI errors after those changes? That way we can

  1. Document possible errors that would need to be fixed
  2. 'Take over' this issue to update samples with those changes