Forum Discussion
ananthuraj
Jun 07, 2023Copper Contributor
Python Flask app for ChatBot not working Properly in Azure Webapp
I have created a python flask framework app which creates a basic chatbot using azure openai llm and embeddings. This uses an index.html template and the site loads and the chat responses work as exp...
azharamir13
Jun 08, 2023Brass Contributor
Check error logs: Enable and review the error logs for your Azure Web App. You can access the logs through the Azure Portal or use tools like Azure CLI or Azure PowerShell. Reviewing the error logs can provide insights into any specific errors or exceptions occurring during deployment.
Verify package versions: Ensure that the packages and dependencies listed in your requirements file are compatible with the Python version used by Azure Web App (3.10 in your case). Check for any package versions that might cause conflicts or compatibility issues. It's also a good practice to pin the versions of the packages you are using to avoid unexpected updates.
Review configuration: Double-check the configuration settings in your Azure Web App. Verify that environment variables, paths, and other settings required by your Flask app are correctly configured in the Azure Web App environment.
Check deployment steps: Compare the deployment steps you followed when the chat functionality was working with the steps you followed when it failed. Ensure that all the necessary files, scripts, and configurations are included and properly deployed to Azure Web App.
Test in local development environment: Create a local development environment that closely matches the Azure Web App environment (e.g., Python 3.10) and test your Flask app there. This will help you identify if any specific differ
Verify package versions: Ensure that the packages and dependencies listed in your requirements file are compatible with the Python version used by Azure Web App (3.10 in your case). Check for any package versions that might cause conflicts or compatibility issues. It's also a good practice to pin the versions of the packages you are using to avoid unexpected updates.
Review configuration: Double-check the configuration settings in your Azure Web App. Verify that environment variables, paths, and other settings required by your Flask app are correctly configured in the Azure Web App environment.
Check deployment steps: Compare the deployment steps you followed when the chat functionality was working with the steps you followed when it failed. Ensure that all the necessary files, scripts, and configurations are included and properly deployed to Azure Web App.
Test in local development environment: Create a local development environment that closely matches the Azure Web App environment (e.g., Python 3.10) and test your Flask app there. This will help you identify if any specific differ
ananthuraj
Jun 08, 2023Copper Contributor
azharamir13 Thanks for the response.
Update : I did try out some of the options you mentioned and the app worked with the chat feature.
But now the issue is, the site will only work for somw time and then it becomes unresponsive. When i go to azure portal and restart the app service it works but thats also not garunteed all the time. Im still using the B1 resource for the app service.
Is there anything that can be done to improve the availability and reliability of the deployed website ?
- azharamir13Jun 08, 2023Brass ContributorMark answer as like if it helps
Upgrade the App Service Plan: Consider upgrading your App Service Plan to a higher tier with more resources, such as CPU, memory, and network bandwidth. The B1 resource may have limited resources, which could be causing the unresponsiveness. Scaling up to a higher tier can provide more capacity for your application to handle increased traffic or resource demands.
Enable Application Insights: Application Insights is an Azure service that helps monitor and diagnose issues in your web application. Enable Application Insights for your Azure Web App to gain insights into the performance, availability, and usage of your application. It can provide telemetry data, metrics, and logs to help troubleshoot and identify any performance bottlenecks or errors.
Implement Caching: Utilize caching mechanisms, such as in-memory caching or distributed caching, to reduce the load on your backend services and improve response times. Caching can help store frequently accessed data or expensive computations, reducing the need to retrieve or compute them repeatedly.- ananthurajJun 13, 2023Copper ContributorI did try out all the methods and still the same issue persists. The site works at times and when its left to idle it wont work again.
- azharamir13Jun 15, 2023Brass Contributoris there any error you have noticed, any logs, please share
- ananthurajJun 08, 2023Copper ContributorI ll try these out and update.