Home

Awesome

an example azure ubuntu virtual machine

Usage (on a Ubuntu Desktop)

Install the tools:

./provision-tools.sh

Login into azure:

az login

List the subscriptions:

az account list --all
az account show

Set the subscription:

export ARM_SUBSCRIPTION_ID="<YOUR-SUBSCRIPTION-ID>"
az account set --subscription "$ARM_SUBSCRIPTION_ID"

Review main.tf and maybe change the location variable.

Initialize terraform:

make terraform-init

Launch the example:

make terraform-apply

At VM initialization time cloud-init will run the provision-app.sh script to launch the example application.

After VM initialization is done (check the boot diagnostics serial log for cloud-init entries), test the app endpoint:

wget -qO- "http://$(terraform output --raw app_ip_address)/test"

And open a shell inside the VM:

ssh "$(terraform output --raw app_ip_address)"
exit

Destroy the example:

make terraform-destroy