Skip to content

Instantly share code, notes, and snippets.

@sjwaight
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sjwaight/b9723e3488d98873dd91 to your computer and use it in GitHub Desktop.
Save sjwaight/b9723e3488d98873dd91 to your computer and use it in GitHub Desktop.
Create a new CentOS 7 Linux VM in Azure
# Script assumes you have setup your subscription and
# have a default storage account in West US.
# You should change these to values you want.
$cloudService = "{cloudservice}"
$hostname = "{dockermanagementhost}"
$linuxUser = "{linxuser}"
$linuxPass = "{linxpasswd}"
$location = "West US"
# use CentOS 7 image
$centOSImageName = (Get-AzureVMImage | Where-Object {$_.ImageName -like "*OpenLogic-CentOS-70*"})[0].ImageName
New-AzureVMConfig -Name $hostname -InstanceSize Small -ImageName $centOSImageName | Add-AzureProvisioningConfig –Linux –LinuxUser $linuxUser -Password $linuxPass | New-AzureVM -ServiceName $cloudService -Location $location
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment