There are two environments you will be working in for the exercises today.
-
Jumpbox: The apps and containers must be run on a Linux machine. A CentOS linux machine has been created for you in your Azure subscription.
Note: If you have bash or ssh available on your machine, it is easiest to access the jump box via SSH. Otherwise, RDP is required.
-
Azure Cloud Shell: The Azure Cloud Shell will be accessed by logging into the Azure Portal (http://portal.azure.com).
Labs 1 and 2 require the Jumpbox. The subsequent labs all use the Azure Cloud Shell.
Once you have accessed the jumpbox, you must clone the workshop repo to the machine.
-
Start with a terminal on the jumpbox
-
Clone the Github repo via the command line
git clone https://github.com/Azure/blackbelt-aks-hackfest.git
The underlying data store for the app is MongoDB. It is already running. We need to import the data for our application.
-
Import the data using a terminal session on the jumpbox
cd ~/blackbelt-aks-hackfest/app/db mongoimport --host localhost:27019 --db webratings --collection heroes --file ./heroes.json --jsonArray && mongoimport --host localhost:27019 --db webratings --collection ratings --file ./ratings.json --jsonArray && mongoimport --host localhost:27019 --db webratings --collection sites --file ./sites.json --jsonArray
The API for the app is written in javascript, running on Node.js and Express
-
Update dependencies and run app via node in a terminal session on the jumpbox
cd ~/blackbelt-aks-hackfest/app/api npm install && npm run localmachine
-
Open a new terminal session on the jumpbox and test the API
use curl
curl http://localhost:3000/api/heroes
If you are in an RDP session, you can browse to http://localhost:3000/api/heroes
The web frontend for the app is written in Vue.js, running on Node.js with Webpack
-
Open a new terminal session on the jumpbox
-
Update dependencies and run app via node
cd ~/blackbelt-aks-hackfest/app/web npm install && npm run localmachine
-
Test the web front-end
The jumpbox has an external DNS name and port 8080 is open. You can browse your running app with a link such as: http://jump-vm-csc4f653357f-q72zm5c4ggcza.eastus.cloudapp.azure.com:8080
You can also test from a new terminal session in the jumpbox
curl http://localhost:8080
Close the web and api apps in the terminal windows by hitting ctrl-c
in each of the corresponding terminal windows