Deploying Flask App with MySQL database

Brandon Harding 1 Reputation point
2022-11-09T03:19:06.873+00:00

I'm having trouble deploying my Flask app with MySQL database. My app runs perfectly when I host it locally. Through Azure I'm able to successfully deploy my MySQL database by itself. I also was able to deploy a basic Flask app displaying a single HTML page. But I can't figure out how to connect the two. Can someone point me in the right direction? I couldn't find any tutorials online except one for PostgreSQL with Flask which hasn't been very useful. Thank you!

Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
765 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,381 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 20,626 Reputation points
    2022-11-11T17:33:39.183+00:00

    Thanks for reaching here! If I have understood right you have deployed Azure Database for MySQL and wants to connect to flask app, If so then you can use below solution:

    Solution 1 - Allow Azure services
    Solution 2 - Create a firewall rule to explicitly allow outbound IPs

    Let us know.

    0 comments No comments