Skip to content

Instantly share code, notes, and snippets.

@naviat
Created December 7, 2017 08:03
Show Gist options
  • Save naviat/d9f0d4c45a3a1a66263573eb7bd25367 to your computer and use it in GitHub Desktop.
Save naviat/d9f0d4c45a3a1a66263573eb7bd25367 to your computer and use it in GitHub Desktop.
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