An open API service indexing awesome lists of open source software.

https://github.com/rgl/azure-ubuntu-vm

an example azure ubuntu virtual machine
https://github.com/rgl/azure-ubuntu-vm

azure example terraform ubuntu

Last synced: 11 months ago
JSON representation

an example azure ubuntu virtual machine

Awesome Lists containing this project

README

          

an example azure ubuntu virtual machine

![](architecture.png)

# Usage (on a Ubuntu Desktop)

Install the tools:

```bash
./provision-tools.sh
```

Login into azure:

```bash
az login
```

List the subscriptions:

```bash
az account list --all
az account show
```

Set the subscription:

```bash
export ARM_SUBSCRIPTION_ID=""
az account set --subscription "$ARM_SUBSCRIPTION_ID"
```

Review `main.tf` and maybe change the `location` variable.

Initialize terraform:

```bash
make terraform-init
```

Launch the example:

```bash
make terraform-apply
```

At VM initialization time [cloud-init](https://cloudinit.readthedocs.io/en/latest/index.html) 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:

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

And open a shell inside the VM:

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

Destroy the example:

```bash
make terraform-destroy
```