How to deploye Flask app on Azure App Service. Best ways which are ested explained below.
- Create Flask project and run it on local using "flask run" command.
- Once everything is good with No errors or warnings, export all the libraries using "pip freez > requirements.txt" command. Which stores all the required libraries and its versions in the text file.
- Create a "commit" and "push" the code to Github repository
- Once done in Azure create an "App service", "App service plan" and the "Applications insights service" (optional) and link it manually or Use VSCode to do the same.
- Then go to "App service > Deployment Center > Source=GitHub, Select Repo, Select Branch and the python version (In this case Python 3.9)".
- Save it and then it starts the deployment from GitHub. We can see the same in the Github repository under Axtions>Workflows.
- We can preview the sites after that usin the URL from the Azure App Service.