Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

AzureScripts

Utility scripts for Azure VM demo and testing purposes. Clone the repo on a VM and run whichever script you need, or execute a script in one shot directly from GitHub.

One-shot execution from GitHub

No clone needed — pipe the raw script straight into bash.

Use refs/heads/main instead of main in the URL. GitHub's CDN caches the short-ref URL aggressively, so /main/ may serve a stale version. The full ref path /refs/heads/main/ bypasses that cache and always returns the latest commit.

curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/setup.sh | sudo bash

To pass arguments (e.g. a custom port):

curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/setup.sh | sudo bash -s -- 8080

Scripts

webserver/setup.sh — Simple HTTP info page

Sets up a lightweight web server that displays the VM's hostname, internal IP, external IP, current datetime, and incoming request headers. Persists across reboots via systemd.

Requirements: Python 3 (pre-installed on most Azure VM images), root access.

Run on the VM:

sudo bash webserver/setup.sh          # port 80
sudo bash webserver/setup.sh 8080     # custom port

One-shot from GitHub:

curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/setup.sh | sudo bash

The script is idempotent — re-running it updates the server and restarts the service.

Manage the service:

sudo systemctl status azure-demo-server
sudo systemctl stop azure-demo-server
sudo systemctl start azure-demo-server

Uninstall:

sudo bash webserver/teardown.sh

Or from GitHub:

curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/teardown.sh | sudo bash

The teardown script stops the service, disables it, removes the systemd unit file, and deletes /opt/azure-demo-server.


demo-vm/setup.sh — Private VM with VNet

Creates a full demo environment from scratch:

Resource Value
Resource group my-rg
VNet my-vnet10.4.0.0/16
Subnet1 my-subnet110.4.1.0/24
Subnet2 my-subnet210.4.2.0/24
VM my-vm — Standard_B1s, Ubuntu 22.04 LTS Gen2, private only

Requirements: Azure CLI installed and logged in (az login).

Run:

bash demo-vm/setup.sh                        # deploys to westeurope
LOCATION=northeurope bash demo-vm/setup.sh   # custom location
ADMIN_USER=myuser bash demo-vm/setup.sh      # custom admin username

Or from GitHub:

curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/demo-vm/setup.sh | bash

SSH keys are generated automatically (~/.ssh/id_rsa) if none exist. The VM has no public IP — access it via Azure Bastion or a jump box on the same VNet.

Teardown (deletes the entire resource group and everything in it):

bash demo-vm/teardown.sh

Or from GitHub:

curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/demo-vm/teardown.sh | bash

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages