You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Azure PowerShell script example: Load balance traffic to VMs for high availability
19
18
20
-
This Azure PowerShell script example creates everything needed to run several Windows virtual machines configured in a highly available and load balanced configuration. After running the script, you will have three virtual machines, joined to an Azure Availability Set, and accessible through an Azure Load Balancer.
19
+
This Azure PowerShell script example creates everything needed to run several Windows virtual machines configured in a highly available and load balanced configuration. After running the script, you'll have three virtual machines, joined to an Azure Availability Set, and accessible through an Azure Load Balancer.
21
20
22
21
If needed, install the Azure PowerShell using the instruction found in the [Azure PowerShell guide](/powershell/azure/), and then run `Connect-AzAccount` to create a connection with Azure.
23
22
@@ -43,24 +42,24 @@ This script uses the following commands to create a resource group, virtual mach
43
42
44
43
| Command | Notes |
45
44
|---|---|
46
-
|[New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup)| Creates a resource group in which all resources are stored. |
47
-
|[New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig)| Creates a subnet configuration. This configuration is used with the virtual network creation process. |
45
+
|[New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup)| Creates a resource group for storing resources. |
46
+
|[New-AzVirtualNetworkSubnetConfig](/powershell/module/az.network/new-azvirtualnetworksubnetconfig)| Creates a subnet configuration. This configuration works with the virtual network creation process. |
48
47
|[New-AzVirtualNetwork](/powershell/module/az.network/new-azvirtualnetwork)| Creates an Azure virtual network and subnet. |
49
48
|[New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress)| Creates a public IP address with a static IP address and an associated DNS name. |
50
49
|[New-AzLoadBalancer](/powershell/module/az.network/new-azloadbalancer)| Creates an Azure load balancer. |
51
-
|[New-AzLoadBalancerProbeConfig](/powershell/module/az.network/new-azloadbalancerprobeconfig)| Creates a load balancer probe. A load balancer probe is used to monitor each VM in the load balancer set. If any VM becomes inaccessible, traffic is not routed to the VM. |
52
-
|[New-AzLoadBalancerRuleConfig](/powershell/module/az.network/new-azloadbalancerruleconfig)| Creates an load balancer rule. In this sample, a rule is created for port 80. As HTTP traffic arrives at the load balancer, it is routed to port 80 one of the VMs in the load balancer set. |
53
-
|[New-AzLoadBalancerInboundNatRuleConfig](/powershell/module/az.network/new-azloadbalancerinboundnatruleconfig)| Creates a load balancer Network Address Translation (NAT) rule. NAT rules map a port of the load balancer to a port on a VM. In this sample, a NAT rule is created for SSH traffic to each VM in the load balancer set.|
50
+
|[New-AzLoadBalancerProbeConfig](/powershell/module/az.network/new-azloadbalancerprobeconfig)| Creates a load balancer probe. A load balancer probe monitors each VM in the load balancer set. If any VM becomes inaccessible, no traffic routes to the VM. |
51
+
|[New-AzLoadBalancerRuleConfig](/powershell/module/az.network/new-azloadbalancerruleconfig)| Creates a load balancer rule. In this sample, you create a rule for port 80. As HTTP traffic arrives at the load balancer, traffic routes to port 80 on one of the VMs in the LB set. |
52
+
|[New-AzLoadBalancerInboundNatRuleConfig](/powershell/module/az.network/new-azloadbalancerinboundnatruleconfig)| Creates a load balancer Network Address Translation (NAT) rule. NAT rules map a port of the load balancer to a port on a VM. This sample creates a NAT rule for SSH traffic to each VM in the load balancer set. |
54
53
|[New-AzNetworkSecurityGroup](/powershell/module/az.network/new-aznetworksecuritygroup)| Creates a network security group (NSG), which is a security boundary between the internet and the virtual machine. |
55
-
|[New-AzNetworkSecurityRuleConfig](/powershell/module/az.network/new-aznetworksecurityruleconfig)| Creates an NSG rule to allow inbound traffic. In this sample, port 22 is opened for SSH traffic. |
54
+
|[New-AzNetworkSecurityRuleConfig](/powershell/module/az.network/new-aznetworksecurityruleconfig)| Creates an NSG rule to allow inbound traffic. This sample creates a rule opening port 22 for SSH traffic. |
56
55
|[New-AzNetworkInterface](/powershell/module/az.network/new-aznetworkinterface)| Creates a virtual network card and attaches it to the virtual network, subnet, and NSG. |
57
-
|[New-AzAvailabilitySet](/powershell/module/az.compute/new-azavailabilityset)| Creates an availability set. Availability sets ensure application uptime by spreading the virtual machines across physical resources such that if failure occurs, the entire set is not effected. |
58
-
|[New-AzVMConfig](/powershell/module/az.compute/new-azvmconfig)| Creates a VM configuration. This configuration includes information such as VM name, operating system, and administrative credentials. The configuration is used during VM creation. |
59
-
|[New-AzVM](/powershell/module/az.compute/new-azvm)| Creates the virtual machine and connects it to the network card, virtual network, subnet, and NSG. This command also specifies the virtual machine image to be used and administrative credentials.|
56
+
|[New-AzAvailabilitySet](/powershell/module/az.compute/new-azavailabilityset)| Creates an availability set. Availability sets ensure application uptime by spreading the virtual machines across physical resources so a failure doesn't affect the entire set. |
57
+
|[New-AzVMConfig](/powershell/module/az.compute/new-azvmconfig)| Creates a VM configuration used during VM creation. This configuration includes information such as VM name, operating system, and administrative credentials. |
58
+
|[New-AzVM](/powershell/module/az.compute/new-azvm)| Creates the virtual machine and connects it to the network card, virtual network, subnet, and NSG. This command also specifies the virtual machine image used and administrative credentials. |
60
59
|[Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup)| Deletes a resource group including all nested resources. |
61
60
62
61
## Next steps
63
62
64
63
For more information on the Azure PowerShell, see [Azure PowerShell documentation](/powershell/azure/).
65
64
66
-
Additional networking PowerShell script samples can be found in the [Azure Networking Overview documentation](../powershell-samples.md?toc=%2fazure%2fnetworking%2ftoc.json).
65
+
Find more networking PowerShell script samples in the [Azure Networking Overview documentation](../powershell-samples.md?toc=%2fazure%2fnetworking%2ftoc.json).
0 commit comments