Skip to content

Instantly share code, notes, and snippets.

@shaikkhajaibrahim
Created December 2, 2018 04:58
Show Gist options
  • Save shaikkhajaibrahim/f5678bfb46f4e6dc8a1593f008ed6d86 to your computer and use it in GitHub Desktop.
Save shaikkhajaibrahim/f5678bfb46f4e6dc8a1593f008ed6d86 to your computer and use it in GitHub Desktop.
$location = "CentralUs"
$resgName = "networkfromps"
# Create a resource group
$networkresg = New-AzureRmResourceGroup -Name $resgName -Location $location
# create a network
$network = New-AzureRmVirtualNetwork -Name ntier -Location $location -AddressPrefix "10.26.0.0/16" -ResourceGroupName $resgName
# creating Web subnet
$webSubnet = Add-AzureRmVirtualNetworkSubnetConfig -Name "Web" -AddressPrefix "10.26.0.0/24" -VirtualNetwork $network
# Create Business Subnet
$businessSubnet = Add-AzureRmVirtualNetworkSubnetConfig -Name "Business" -AddressPrefix "10.26.1.0/24" -VirtualNetwork $network
#Submitting changes to Azure
Set-AzureRmVirtualNetwork -VirtualNetwork $network
# Create Linux VM in Web Subnet
# Create Windows Vm in Business Subnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment