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.
No clone needed — pipe the raw script straight into bash.
Use
refs/heads/maininstead ofmainin 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 bashTo pass arguments (e.g. a custom port):
curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/setup.sh | sudo bash -s -- 8080Sets 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 portOne-shot from GitHub:
curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/setup.sh | sudo bashThe 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-serverUninstall:
sudo bash webserver/teardown.shOr from GitHub:
curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/webserver/teardown.sh | sudo bashThe teardown script stops the service, disables it, removes the systemd unit file, and deletes /opt/azure-demo-server.
Creates a full demo environment from scratch:
| Resource | Value |
|---|---|
| Resource group | my-rg |
| VNet | my-vnet — 10.4.0.0/16 |
| Subnet1 | my-subnet1 — 10.4.1.0/24 |
| Subnet2 | my-subnet2 — 10.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 usernameOr from GitHub:
curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/demo-vm/setup.sh | bashSSH 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.shOr from GitHub:
curl -fsSL https://raw.githubusercontent.com/ddewaele/AzureScripts/refs/heads/main/demo-vm/teardown.sh | bash