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
- Host: GitHub
- URL: https://github.com/rgl/azure-ubuntu-vm
- Owner: rgl
- Created: 2018-12-23T13:20:11.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-21T14:16:53.000Z (over 1 year ago)
- Last Synced: 2024-12-31T11:05:56.958Z (about 1 year ago)
- Topics: azure, example, terraform, ubuntu
- Language: HCL
- Size: 92.8 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
an example azure ubuntu virtual machine

# 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
```