This tutorial azure cloud project demonstrates how to install a basic web app on a virtual machine. We will use our azure account to create a resource group and virtual machine. Then we will install and configure the virtual machine to run the nginx web server and python. Our web app is a flask template and python web application uploaded to our virtual machine and configured to run with nginx.
Watch the video tutorials and follow step-by-step instructions to learn how to create your own starter web app running on an azure cloud virtual machine.
Watch the video tutorials and follow step-by-step instructions to learn how to create your own starter web app running on an azure cloud virtual machine.
Step #5 - Configure and Deploy Web Server
Start your virtual machine (VM) and record your public IP address
In Visual Studio Code (VSC) open a terminal window and login to azure.
SSH login to your VM in the terminal window ssh projectadmin@IPADDRESS
Username: (username you chosen) projectadmin
Password: (password you chosen) projectadmin|2021
Update the VM package repository information sudo apt-get -y update
Install the web server nginx and python which will run our web app on the server sudo apt-get -y install nginx python3-venv
Setup the reverse proxy for our nginx web server
Open a new terminal window and navigate to /etc/nginx/sites-available
Unlink the existing default reverse proxy file sudo unlink /etc/nginx/sites-enabled/default
Open up a new terminal window and secure copy our reverse-proxy.conf file to our home directory scp -r reverse-proxy.conf projectadmin@IPADDRESS:/home/projectadmin
Switch back to our ssh terminal window (connected to the VM) and verify the file has been copied to the projectadmin home directory
Move the reverse-proxy.conf sudo mv reverse-proxy.conf /etc/nginx/sites-available
Navigate to the sites-available directory cd /etc/nginx/sites-available
Verify the reverse-proxy.conf file is in the directory
Link our proxy file to the sites-enabled sudo ln -s /etc/nginx/sites-available/reverse-proxy.conf /etc/nginx/sites-enabled/reverse-proxy.conf
Restart the nginx service sudo service nginx restart
Navigate to the web-app directory
Setup the python virtual environment python3 -m venv ven
Activate the python environment source venv/bin/activate
Upgrade pip in the virtual environment pip install --upgrade pip
Install dependencies for our web-app project pip install -r requirements.txt
Run the python web app python application.py
Open a web browser and navigate to the public IP address of your virtual machine
Voila! You have successfully created a Flask web application running on an azure virtual machine.
Congratulations!
GitHub Project Repo
https://github.com/kathleenwest/Azure...
Project Series - Azure Virtual Machine Web App Demo (5 Episodes) See Link Below
• Azure Virtual Machine Web App Tutoria...