Followers

Showing posts with label 5.Creating Azure Standard Load Balancers with PowerShell. Show all posts
Showing posts with label 5.Creating Azure Standard Load Balancers with PowerShell. Show all posts

Thursday, 7 December 2023

5.Creating Azure Standard Load Balancers with PowerShell

 Creating Azure Standard Load Balancers with PowerShell

  • Creating variables to store key parameters.

  • Identifying the proper cmdlets to create a frontend IP configuration, backend address pool, health probe, Load Balancer rule configuration, and NAT rules.

  • Creating the Azure Standard Load Balancer using the correct parameters.

    Create the Variables

    1. Click the Cloud Shell icon (>_) at the top of the page.

    2. Click PowerShell.

    3. Click Show advanced settings.

    4. Use the combo box under Cloud Shell region to select West US.

    5. Under Storage account, click the radio button for Use existing.

    6. In the box under File share, enter "shell".

    7. Click Create storage.

    8. Identify the current resource group.

      get-azresourcegroup

    9. Select the ResourceGroupName value and copy it to the clipboard.

    10. Create a variable and set it to the value copied in the previous step.

      $resource='RESOURCE_GROUP_NAME'

    11. Set the location variable.

      $location='westus'

    12. Create the public IP address.

      $publicIP = New-AzPublicIpAddress ` -ResourceGroupName $resource ` -Name 'myPublicIp' ` -Location $location ` -AllocationMethod static ` -Sku Standard

    13. Create the frontend IP configuration.

      $feip = New-AzLoadBalancerFrontendIpConfig -Name 'MyFrontEndPool' -PublicIPAddress $publicIP

    14. Create the backend address pool.

      $bepool = New-AzLoadBalancerBackEndAddressPoolConfig -Name 'myBackEndPool'

    15. Create the health probe.

      $probe = New-AzLoadBalancerProbeConfig ` -Name 'myHealthProbe' ` -Protocol Http ` -Port 80 ` -RequestPath / ` -IntervalInSeconds 360 ` -ProbeCount 5

    16. Create the Load Balancer rule.

      $rule = New-AzLoadBalancerRuleConfig ` -Name 'myLoadBalancerRuleWeb' ` -Protocol Tcp ` -Probe $probe ` -FrontendPort 80 ` -BackendPort 80 ` -FrontendIpConfiguration $feip ` -BackendAddressPool $bepool

    17. Create the necessary NAT rules.

      $natrule1 = New-AzLoadBalancerInboundNatRuleConfig ` -Name 'myLoadBalancerRDP1' ` -FrontendIpConfiguration $feip ` -Protocol tcp ` -FrontendPort 4221 ` -BackendPort 3389 $natrule2 = New-AzLoadBalancerInboundNatRuleConfig ` -Name 'myLoadBalancerRDP2' ` -FrontendIpConfiguration $feip ` -Protocol tcp ` -FrontendPort 4222 ` -BackendPort 3389 $natrule3 = New-AzLoadBalancerInboundNatRuleConfig ` -Name 'myLoadBalancerRDP3' ` -FrontendIpConfiguration $feip ` -Protocol tcp ` -FrontendPort 4223 ` -BackendPort 3389

    Create the Azure Standard Load Balancer

    1. Create the Load Balancer.

      New-AzLoadBalancer ` -ResourceGroupName $resource ` -Name 'myLoaBalancer' ` -Sku Standard ` -Location $location ` -FrontendIpConfiguration $feip ` -BackendAddressPool $bepool ` -Probe $probe ` -LoadBalancingRule $rule ` -InboundNatRule $natrule1,$natrule2,$natrule3

12. Creating a Hub and Spoke Network with a DMZ and Allowing Access to Azure Arc and Other Microsoft URLs from the Azure Portal

12. Creating a Hub and Spoke Network with a DMZ and Allowing Access to Azure Arc and Other Microsoft URLs from the Azure Portal. 1. Create a...