Hi Gorthi Sai Sri Sindhuja ,As Lex mentioned, we will need more info to help answer your question specifically. But generally, the issue you’re experiencing is likely due to the fact that “localhost” within the context of an Azure App Service refers to the local environment of the App Service itself, not your local machine<sup>.</sup> This means that if you’re trying to access a server running on your local machine from your Flask app hosted on Azure, it won’t be able to find it, hence the internal server error. A few things to consider:
- You could expose your local server to the internet using a service like ngrok, and then update your Flask app to use the public URL provided by ngrok instead of localhost.
- If your Flask app and the server it’s trying to access need to communicate frequently, it might be more efficient to host both on Azure. You could use an Azure Virtual Machine or another App Service to host your server.
- Azure supports Hybrid Connections, which can be used to access a TCP endpoint (like a server) on your local network from an App Service.
Grace