Revisions
-
wortho revised this gist
Jan 29, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -57,10 +57,14 @@ $lbrule3 = New-AzureRmLoadBalancerRuleConfig -Name "NAV" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 7046 -BackendPort 7046 -LoadDistribution SourceIPProtocol $lbrule4 = New-AzureRmLoadBalancerRuleConfig -Name "NAVHELP" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 49000 -BackendPort 49000 $alb = New-AzureRmLoadBalancer -ResourceGroupName $resourceGroupName ` -Name "ALB" -Location $location -FrontendIpConfiguration $feIpConfig ` -InboundNatRule $inboundNatRule1,$inboundNatRule2 ` -LoadBalancingRule ($lbrule1,$lbrule2,$lbrule3,$lbrule4) -BackendAddressPool $beAddressPool ` -Probe $healthProbe $nic1 = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName ` -
wortho revised this gist
Jan 29, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,11 +51,11 @@ $lbrule1 = New-AzureRmLoadBalancerRuleConfig -Name "HTTP" ` $lbrule2 = New-AzureRmLoadBalancerRuleConfig -Name "HTTPS" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 443 -BackendPort 443 -LoadDistribution SourceIPProtocol $lbrule3 = New-AzureRmLoadBalancerRuleConfig -Name "NAV" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 7046 -BackendPort 7046 -LoadDistribution SourceIPProtocol $alb = New-AzureRmLoadBalancer -ResourceGroupName $resourceGroupName ` -Name "ALB" -Location $location -FrontendIpConfiguration $feIpConfig ` -
wortho revised this gist
Jan 29, 2016 . 1 changed file with 22 additions and 14 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +1,20 @@ $testName = "unique-resource-name" $resourceGroupName = $testName $location = "northeurope" $domainName = $testName $subnetName = "Subnet-1" $publisher = "MicrosoftDynamicsNAV" $offer = "DynamicsNAV" $sku = "2016" $version = "latest" $cred = Get-Credential New-AzureRmResourceGroup -Name $resourceGroupName -Location $location $vip = New-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName -Name "PublicIP1" ` -Location $location -AllocationMethod Dynamic -DomainNameLabel $domainName @@ -43,17 +42,25 @@ $beAddressPool = New-AzureRmLoadBalancerBackendAddressPoolConfig -Name "LBBE" $healthProbe = New-AzureRmLoadBalancerProbeConfig -Name "HealthProbe" ` -RequestPath "Default.aspx" -Protocol http -Port 80 ` -IntervalInSeconds 15 -ProbeCount 2 $lbrule1 = New-AzureRmLoadBalancerRuleConfig -Name "HTTP" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80 $lbrule2 = New-AzureRmLoadBalancerRuleConfig -Name "HTTPS" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 443 -BackendPort 443 $lbrule3 = New-AzureRmLoadBalancerRuleConfig -Name "NAV" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 7046 -BackendPort 7046 $alb = New-AzureRmLoadBalancer -ResourceGroupName $resourceGroupName ` -Name "ALB" -Location $location -FrontendIpConfiguration $feIpConfig ` -InboundNatRule $inboundNatRule1,$inboundNatRule2 ` -LoadBalancingRule ($lbrule1,$lbrule2,$lbrule3) -BackendAddressPool $beAddressPool ` -Probe $healthProbe $nic1 = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName ` @@ -83,7 +90,7 @@ For ($i=0; $i -le 1; $i++) { $vmName = "$testName-w$i" $vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize "Standard_DS1" ` -AvailabilitySetId $avSet.Id | Set-AzureRmVMOperatingSystem -Windows -ComputerName $vmName ` @@ -101,11 +108,12 @@ For ($i=0; $i -le 1; $i++) { -VM $vmConfig } $ipAddr = Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName $ipAddr.IpAddress $ipAddr.DnsSettings.Fqdn Find-AzureRmResource -ResourceGroupNameContains $resourceGroupName | Select Name, ResourceType <# Remove-AzureRmResourceGroup -Name $resourceGroupName -
nmackenzie created this gist
Oct 25, 2015 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,112 @@ $testName = "lower-case-unique-name" $resourceGroupName = $testName $location = "westus" $domainName = $testName $subnetName = "Subnet-1" $publisher = "MicrosoftWindowsServer" $offer = "WindowsServer" $sku = "2012-R2-Datacenter" $version = "latest" $cred = Get-Credential New-AzureRmResourceGroup -Name $resourceGroupName -Location $location $vip = New-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName -Name "VIP1" ` -Location $location -AllocationMethod Dynamic -DomainNameLabel $domainName $subnet = New-AzureRmVirtualNetworkSubnetConfig -Name $subnetName ` -AddressPrefix "10.0.64.0/24" $vnet = New-AzureRmVirtualNetwork -Name "VNET" ` -ResourceGroupName $resourceGroupName ` -Location $location -AddressPrefix "10.0.0.0/16" -Subnet $subnet $subnet = Get-AzureRmVirtualNetworkSubnetConfig -Name $subnetName -VirtualNetwork $vnet $feIpConfig = New-AzureRmLoadBalancerFrontendIpConfig -Name $testName -PublicIpAddress $vip $inboundNatRule1 = New-AzureRmLoadBalancerInboundNatRuleConfig -Name "RDP1" ` -FrontendIpConfiguration $feIpConfig ` -Protocol TCP -FrontendPort 3441 -BackendPort 3389 $inboundNatRule2 = New-AzureRmLoadBalancerInboundNatRuleConfig -Name "RDP2" ` -FrontendIpConfiguration $feIpConfig ` -Protocol TCP -FrontendPort 3442 -BackendPort 3389 $beAddressPool = New-AzureRmLoadBalancerBackendAddressPoolConfig -Name "LBBE" $healthProbe = New-AzureRmLoadBalancerProbeConfig -Name "HealthProbe" ` -RequestPath "HealthProbe.aspx" -Protocol http -Port 80 ` -IntervalInSeconds 15 -ProbeCount 2 $lbrule = New-AzureRmLoadBalancerRuleConfig -Name "HTTP" ` -FrontendIpConfiguration $feIpConfig -BackendAddressPool $beAddressPool ` -Probe $healthProbe -Protocol Tcp -FrontendPort 80 -BackendPort 80 $alb = New-AzureRmLoadBalancer -ResourceGroupName $resourceGroupName ` -Name "ALB" -Location $location -FrontendIpConfiguration $feIpConfig ` -InboundNatRule $inboundNatRule1,$inboundNatRule2 ` -LoadBalancingRule $lbrule -BackendAddressPool $beAddressPool ` -Probe $healthProbe $nic1 = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName ` -Name "nic1" -Subnet $subnet -Location $location ` -LoadBalancerInboundNatRule $alb.InboundNatRules[0] ` -LoadBalancerBackendAddressPool $alb.BackendAddressPools[0] $nic2 = New-AzureRmNetworkInterface -ResourceGroupName $resourceGroupName ` -Name "nic2" -Subnet $subnet -Location $location ` -LoadBalancerInboundNatRule $alb.InboundNatRules[1] ` -LoadBalancerBackendAddressPool $alb.BackendAddressPools[0] New-AzureRmAvailabilitySet -ResourceGroupName $resourceGroupName ` -Name "AVSet" -Location $location $avset = Get-AzureRmAvailabilitySet -ResourceGroupName $resourceGroupName -Name "AVSet" New-AzureRmStorageAccount -ResourceGroupName $resourceGroupName ` -Name $testName -Location $location -Type Standard_LRS Get-AzureRmStorageAccount -ResourceGroupName $resourceGroupName [array]$nics = @($nic1,$nic2) For ($i=0; $i -le 1; $i++) { $vmName = "$testName-w$i" $vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize "Standard_A1" ` -AvailabilitySetId $avSet.Id | Set-AzureRmVMOperatingSystem -Windows -ComputerName $vmName ` -Credential $cred -ProvisionVMAgent -EnableAutoUpdate | Set-AzureRmVMSourceImage -PublisherName $publisher -Offer $offer -Skus $sku ` -Version $version | Set-AzureRmVMOSDisk -Name $vmName -VhdUri "https://$testName.blob.core.windows.net/vhds/$vmName-os.vhd" ` -Caching ReadWrite -CreateOption fromImage | Add-AzureRmVMNetworkInterface -Id $nics[$i].Id New-AzureRmVM -ResourceGroupName $resourceGroupName -Location $location ` -VM $vmConfig } (Get-AzureRmPublicIpAddress -ResourceGroupName $resourceGroupName).IpAddress Get-AzureRmResource -ResourceGroupName $resourceGroupName | Select Name, ResourceType <# Remove-AzureRmResourceGroup -Name $resourceGroupName #>