Skip to content

Instantly share code, notes, and snippets.

@astaykov
Created December 9, 2013 08:14
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 astaykov/7868954 to your computer and use it in GitHub Desktop.
Save astaykov/7868954 to your computer and use it in GitHub Desktop.
PowerShell to deploy DNS server VM to Windows Azure by specifying local DNS settings. Important are lines 6 and 11!
Add-AzureAccount
Set-AzureSubscription "[Your Subscription Name]" -CurrentStorageAccountName "[StorageAccount_for_VHDs]"
$adminPassword = "Super_Secret_Password!"
$images = Get-AzureVMImage | where {$_.Label -match "Windows Server 2012 R2"}
$vmImage = $images[2]
$dnsServerLocal = New-AzureDns –Name "NameResolver" –IPAddress "127.0.0.1"
New-AzureVMConfig -Name "NameResolver" -InstanceSize Large -ImageName $vmImage.ImageName ` |
Add-AzureProvisioningConfig –Windows –Password $adminPassword -AdminUsername "astaykov" ` |
Set-AzureSubnet "NSNet" ` |
New-AzureVM –ServiceName "nameresolver"-VNetName "VNET-DEMO-WE" -DnsSettings $dnsServerLocal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment