참고 자료
더보기
Update the load balancer for your scale set - docs.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-upgrade-scale-set#update-the-load-balancer-for-your-scale-set
Azure VMSS의 Load Balancer를 Application Gateway로 변경하는 방법과 반대로 Application Gateway를 Load Balancer로 변경하는 방법입니다.
생각보다 간단한데, 자료를 찾기가 어려웠습니다.
Azure VMSS의 Load Balancer를 Application Gataeway로 변경
# Get the current model of the scale set and store it in a local PowerShell object named $vmss
$vmss=Get-AzVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet"
# Create a local PowerShell object for the new desired IP configuration, which includes the reference to the application gateway
$ipconf = New-AzVmssIPConfig "myNic" -ApplicationGatewayBackendAddressPoolsId /subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{applicationGatewayBackendAddressPoolName} -SubnetId $vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].IpConfigurations[0].Subnet.Id –Name $vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].IpConfigurations[0].Name
# Replace the existing IP configuration in the local PowerShell object (which contains the references to the current Azure Load Balancer) with the new IP configuration
$vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].IpConfigurations[0] = $ipconf
# Update the model of the scale set with the new configuration in the local PowerShell object
Update-AzVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet" -virtualMachineScaleSet $vmss
Azure VMSS의 Application Gateway를 Load Balancer로 변경
# Create a local PowerShell object for the new desired IP configuration, which includes the reference to the application gateway
$ipconf = New-AzVmssIPConfig "myNic2" -LoadBalancerBackendAddressPoolsId /subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{loadBalancerBackendPoolName} -SubnetId $vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].IpConfigurations[0].Subnet.Id –Name $vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].IpConfigurations[0].Name
# Replace the existing IP configuration in the local PowerShell object (which contains the references to the current Azure Load Balancer) with the new IP configuration
$vmss.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].IpConfigurations[0] = $ipconf
# Update the model of the scale set with the new configuration in the local PowerShell object
Update-AzVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet" -virtualMachineScaleSet $vmss
아래는 Cloud shell에서 VMSS의 Applicaton Gateway를 Load Balancer로 변경하는 화면 캡처입니다.
위 명령을 실행하고 난 후, VMSS에서 인스턴스를 업그레이드(Upgrade) 해야 실제로 반영됩니다.
-끝-
'Microsoft > Azure' 카테고리의 다른 글
Azure VM Extension (가상머신 확장) (0) | 2021.01.30 |
---|---|
온프레미스에서 Azure Private DNS 사용 (0) | 2020.12.12 |
Azure VPN Gateway 배포 및 S2S VPN 연결 (1) | 2020.12.09 |
Azure Database for PostgreSQL 복제 (Replication) (0) | 2020.12.08 |
D_v4 (E_v4) 시리즈 비교 (0) | 2020.12.07 |