Skip to content

Instantly share code, notes, and snippets.

@subhendu-de
Last active July 11, 2021 05:59
Show Gist options
  • Save subhendu-de/5ec383d35edeecc845ce6a1ef27821ee to your computer and use it in GitHub Desktop.
Save subhendu-de/5ec383d35edeecc845ce6a1ef27821ee to your computer and use it in GitHub Desktop.
REM Use az cli version 2.14.0
REM Log in to Azure and authenticate interactively
az login
REM Create the Azure linux vm with default public key id_rsa.pub
REM The resource group myResourceGroups should exists else create it
az vm create ^
--resource-group myResourceGroups ^
--name ubuntu-vm-20102020 ^
--image UbuntuLTS ^
--admin-username azureuser ^
--ssh-key-values .ssh\id_rsa.pub
REM Create the Azure linux vm with specific public key ubuntu.pub
REM The resource group myResourceGroups should exists else create it
az vm create ^
--resource-group myResourceGroups ^
--name ubuntu-vm-20102020 ^
--image UbuntuLTS ^
--admin-username azureuser ^
--ssh-key-values .ssh\ubuntu.pub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment