Based on the error message you have shared, I think there is an issue with the connection between your Azure App Service and the Azure SQL Database.
Verify that the connection string used by your application in the Azure App Service is correct and includes all necessary parameters. Sometimes, configurations that work locally might not be suitable for cloud environments due to differences in networking or security settings.
If you are using a Managed Identity for authentication, ensure that it is properly configured and has the necessary permissions to access the Azure SQL Database.
Or, if your Azure SQL Database is inside a virtual network, you may need to verify the VNet Integration for your Azure App Service.
Old threads :
https://stackoverflow.com/questions/50046158/pyodbc-login-timeout-error