Skip to content

Instantly share code, notes, and snippets.

@mlapida
Last active August 29, 2015 14:11
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 mlapida/d3358e84b501bb754b96 to your computer and use it in GitHub Desktop.
Save mlapida/d3358e84b501bb754b96 to your computer and use it in GitHub Desktop.
Azure + Chef VM Creation
New-AzureVMConfig -ImageName $image.ImageName -Name $VMName -InstanceSize Small -AvailabilitySetName $serviceName |
#Add VM to a domain
Add-AzureProvisioningConfig -EnableWinRMHttp -AdminUsername $VMUserName -Password $VMPassword -WindowsDomain -DomainUsername $DomainUserName -DomainPassword $DomainPassword -Domain $domain -JoinDomain $domain |
#Add a load balanced endpoint
Add-AzureEndpoint -Name "HTTP" -Protocol tcp -LocalPort "80" -LBSetName "HTTPforChef" -PublicPort "80" -DefaultProbe |
Add-AzureDataDisk -CreateNew -DiskSizeInGB 1023 -DiskLabel "Data" -LUN 0 |
Set-AzureSubnet -SubnetNames "Subnet-1" |
#Install the Chef extension
Set-AzureVMChefExtension -ValidationPem $chefpem -Windows -ClientRb $chefclient -RunList $runlist |
New-AzureVM -ServiceName $serviceName -VNetName $vnetName -Location "South Central US" -WaitForBoot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment