Skip to content

Instantly share code, notes, and snippets.

@pascals-msft
Created December 18, 2021 15:20
Show Gist options
  • Save pascals-msft/e2b0b5224ae002bcc0c6be4f106f65af to your computer and use it in GitHub Desktop.
Save pascals-msft/e2b0b5224ae002bcc0c6be4f106f65af to your computer and use it in GitHub Desktop.
# demo: new linux VM in Azure
# you need az and a SSH key in ~/.ssh
demo=demo$RANDOM
rgname=${demo}rg
vmname=${demo}vm
location=westeurope
az group create -l $location -n $rgname -o yamlc
az vm create --image UbuntuLTS -g $rgname -n $vmname -o yamlc
pip=$(az vm show -g $rgname -n $vmname -d --query publicIps -o tsv)
ssh $pip
# delete everything
az group delete -g $rgname -y --no-wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment