Skip to content

Commit 6739cf7

Browse files
author
Michael Bender
committed
Acrolinx
1 parent e93e703 commit 6739cf7

File tree

4 files changed

+278
-4
lines changed

4 files changed

+278
-4
lines changed

articles/load-balancer/cross-subscription-how-to-attach-backend.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.custom:
1212
---
1313

1414
# Attach a cross-subscription backend to an Azure Load Balancer
15-
In this article, you will learn how to attach a cross-subscription backend to an Azure Load Balancer by creating a cross-subscription backend pool and attaching cross-subscription network interfaces to the backend pool of the load balancer.
15+
In this article, you learn how to attach a cross-subscription backend to an Azure Load Balancer by creating a cross-subscription backend pool and attaching cross-subscription network interfaces to the backend pool of the load balancer.
1616

1717
A [cross-subscription internal load balancer (ILB)](cross-subscription-load-balancer-overview.md) can reference a virtual network that resides in a different subscription other than the load balancers. This feature allows you to deploy a load balancer in one subscription and reference a virtual network in another subscription.
1818

@@ -123,4 +123,5 @@ az network lb address-pool update --lb-name myLoadBalancer --resource-group myRe
123123

124124
## Next steps
125125

126-
> [!div class="nextstepaction"]
126+
> [!div class="nextstepaction"]
127+
> [Create a cross-subscription internal load balancer](./cross-subscription-howto-internal-load-balancer.md)

articles/load-balancer/cross-subscription-how-to-attach-frontend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.custom:
1515

1616
In this article, you learn how to create a load balancer in one Azure subscription and attach a frontend IP address from another subscription. You create a resource group for the load balancer and then create a load balancer with a frontend IP address. You also create a backend address pool, health probe, and load balancer rule.
1717

18-
A [cross-subscription internal load balancer (ILB)](cross-subscription-load-balancer-overview.md) can reference a virtual network that resides in a different subscription other than the load balancers. This feature allows you to deploy a load balancer in one subscription and reference a virtual network in another subscription. s.
18+
A [cross-subscription internal load balancer (ILB)](cross-subscription-load-balancer-overview.md) can reference a virtual network that resides in a different subscription other than the load balancers. This feature allows you to deploy a load balancer in one subscription and reference a virtual network in another subscription.
1919

2020
[!INCLUDE [load-balancer-cross-subscription-preview](../../includes/load-balancer-cross-subscription-preview.md)]
2121

Lines changed: 272 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,272 @@
1+
---
2+
title: Create a global load balancer with cross-subscription backends
3+
titleSuffix: Azure Load Balancer
4+
description: Learn how to create a global load balancer with cross-subscription backends by connecting a virtual network in a subscription to a load balancer in a different subscription.
5+
services: load-balancer
6+
author: mbender-ms
7+
ms.service: load-balancer
8+
ms.topic: how-to
9+
ms.date: 05/24/2024
10+
ms.author: mbender
11+
ms.custom:
12+
---
13+
14+
# Create a global load balancer with cross-subscription backends
15+
16+
In this article, you learn how to create a global load balancer with cross-subscription backends.
17+
18+
A [cross-subscription internal load balancer (ILB)](cross-subscription-load-balancer-overview.md) can reference a virtual network that resides in a different subscription other than the load balancers. This feature allows you to deploy a load balancer in one subscription and reference a virtual network in another subscription.
19+
20+
[!INCLUDE [load-balancer-cross-subscription-preview](../../includes/load-balancer-cross-subscription-preview.md)]
21+
22+
## Prerequisites
23+
24+
# [Azure PowerShell](#tab/azurepowershell)
25+
26+
- Two Azure subscriptions.
27+
- An Azure account with active subscriptions. [Create an account for free](https://azure.microsoft.com/free/)
28+
- A global public IP address deployed in **Azure Subscription A**.
29+
- A regional load balancer deployed in **Azure Subscription B**.
30+
- Azure PowerShell installed locally or Azure Cloud Shell.
31+
32+
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 5.4.1 or later. Run `Get-Module -ListAvailable Az` to find the installed version. If you need to upgrade, see Install Azure PowerShell module. If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
33+
34+
> [!IMPORTANT]
35+
> All of the code samples will use example names and placeholders. Be sure to replace these with the values from your environment.
36+
> The values needing replacement will be enclosed in angle brackets, like this: `<example value>`.
37+
>
38+
39+
# [Azure CLI](#tab/azurecli/)
40+
41+
- Two Azure subscriptions. One subscription for the virtual network (**Azure Subscription A**) and another subscription for the load balancer(**Azure Subscription B**).
42+
- An Azure account with active subscriptions. [Create an account for free](https://azure.microsoft.com/free/)
43+
- A global public IP address deployed in **Azure Subscription A**.
44+
- A regional load balancer deployed in **Azure Subscription B**.
45+
46+
[!INCLUDE [azure-cli-prepare-your-environment.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
47+
48+
If you choose to install and use the CLI locally, this quickstart requires Azure CLI version 2.60 or later. To find the version, run az --version. If you need to install or upgrade, see Install the Azure CLI.
49+
50+
> [!IMPORTANT]
51+
> All of the code samples will use example names and placeholders. Be sure to replace these with the values from your environment.
52+
> The values needing replacement will be enclosed in angle brackets, like this: `<example value>`.
53+
54+
---
55+
56+
## Sign in to Azure
57+
58+
# [Azure PowerShell](#tab/azurepowershell)
59+
60+
With Azure PowerShell, you sign into Azure with [`Connect-AzAccount`](/powershell/module/az.accounts/connect-azaccount), and change your subscription context with [`Set-AzContext`](/powershell/module/az.accounts/set-azcontext) to **Azure Subscription A**. Then get the regional load balancer information with [`Get-AzLoadBalancer`](/powershell/module/az.network/get-azloadbalancer) and [`Get-AzLoadBalancerFrontendIpConfig](/powershell/module/az.network/get-azloadbalancerfrontendipconfig). You need the Azure subscription ID, resource group name, and virtual network name from your environment.
61+
62+
63+
```azurepowershell
64+
65+
# Sign in to Azure
66+
Connect-AzAccount
67+
68+
# Set the subscription context to Azure Subscription A
69+
Set-AzContext -Subscription '<Azure Subscription A>'
70+
71+
# Get the Virtual Network information with Get-AzVirtualNetwork
72+
$rlb= @{
73+
Name = '<regional load balancer name>'
74+
ResourceGroupName = '<Resource Group Subscription A>'
75+
}
76+
$RLB-info = Get-AzLoadBalancer @rlb
77+
$RLBFE = Get-AzLoadBalancerFrontendIpConfig @ RLB-info
78+
79+
```
80+
81+
# [Azure CLI](#tab/azurecli/)
82+
83+
```azurecli
84+
85+
With Azure CLI, you'll sign into Azure with [az login](/cli/azure/reference-index#az-login), and change your subscription context with [`az account set`](/cli/azure/account#az_account_set) to **Azure Subscription A**.
86+
87+
```azurecli
88+
89+
# Sign in to Azure CLI and change subscription to Azure Subscription B
90+
Az login
91+
Az account set –subscription <Azure Subscription A>
92+
```
93+
94+
---
95+
96+
## Create a resource group
97+
98+
In this section, you create a resource group in **Azure Subscription B**. This resource group is for all of your resources associate with your load balancer.
99+
100+
# [Azure PowerShell](#tab/azurepowershell)
101+
102+
With Azure PowerShell, you switch the subscription context with [`Set-AzContext`](/powershell/module/az.accounts/set-azcontext) and create a resource group with [`New-AzResourceGroup`](/powershell/module/az.resources/new-azresourcegroup).
103+
104+
```azurepowershell
105+
106+
# Set the subscription context to Azure Subscription B
107+
Set-AzContext -Subscription '<Azure Subscription B>'
108+
109+
# Create a resource group
110+
$rg = @{
111+
Name = 'myResourceGroupLB'
112+
Location = 'westus'
113+
}
114+
New-AzResourceGroup @rg
115+
```
116+
> [!NOTE]
117+
> When create the resource group for your load balancer, use the same Azure region as the virtual network in **Azure Subscription A**.
118+
119+
# [Azure CLI](#tab/azurecli/)
120+
121+
With Azure CLI, you switch the subscription context with [`az account set`](/cli/azure/account#az_account_set) and create a resource group with [`az group create`](/cli/azure/group#az_group_create).
122+
123+
```azurecli
124+
# Create a resource group in Azure Subscription B
125+
az group create --name 'myResourceGroupLB' --location westus
126+
```
127+
128+
> [!NOTE]
129+
> When create the resource group for your load balancer, use the same Azure region as the virtual network in **Azure Subscription A**.
130+
131+
---
132+
133+
## Create a global load balancer
134+
135+
In this section, you create the resources needed for the cross-region load balancer.
136+
A global standard sku public IP is used for the frontend of the cross-region load balancer.
137+
138+
# [Azure PowerShell](#tab/azurepowershell)
139+
140+
With Azure PowerShell, you:
141+
142+
- Use [`New-AzPublicIpAddress`](/powershell/module/az.network/new-azpublicipaddress) to create the public IP address.
143+
- Create a frontend IP configuration with [`New-AzLoadBalancerFrontendIpConfig`](/powershell/module/az.network/new-azloadbalancerfrontendipconfig).
144+
- Create a backend address pool with [`New-AzLoadBalancerBackendAddressPoolConfig`](/powershell/module/az.network/new-azloadbalancerbackendaddresspoolconfig).
145+
- Create a load balancer rule with [`Add-AzLoadBalancerRuleConfig`](/powershell/module/az.network/add-azloadbalancerruleconfig).
146+
- Create a global load Balancer with [`New-AzLoadBalancer`](/powershell/module/az.network/new-azloadbalancer).
147+
148+
```azurepowershell
149+
# Create global IP address for load balancer
150+
$ip = @{
151+
Name = 'myPublicIP-CR'
152+
ResourceGroupName = ‘ Resource Group B’
153+
Location = 'eastus2'
154+
Sku = 'Standard'
155+
Tier = 'Global'
156+
AllocationMethod = 'Static'
157+
}
158+
$publicIP = New-AzPublicIpAddress @ip
159+
160+
# Create frontend configuration
161+
$fe = @{
162+
Name = 'myFrontEnd-CR'
163+
PublicIpAddress = $publicIP
164+
}
165+
$feip = New-AzLoadBalancerFrontendIpConfig @fe
166+
167+
# Create backend address pool
168+
$be = @{
169+
Name = 'myBackEndPool-CR'
170+
}
171+
$bepool = New-AzLoadBalancerBackendAddressPoolConfig @be
172+
173+
# Create the load balancer rule
174+
$rul = @{
175+
Name = 'myHTTPRule-CR'
176+
Protocol = 'tcp'
177+
FrontendPort = '80'
178+
BackendPort = '80'
179+
FrontendIpConfiguration = $feip
180+
BackendAddressPool = $bepool
181+
}
182+
$rule = New-AzLoadBalancerRuleConfig @rul
183+
184+
# Create cross-region load balancer resource
185+
$lbp = @{
186+
ResourceGroupName = ‘ Resource Group B’
187+
Name = 'myLoadBalancer-CR'
188+
Location = ‘eastus2’
189+
Sku = 'Standard'
190+
Tier = 'Global'
191+
FrontendIpConfiguration = $feip
192+
BackendAddressPool = $bepool
193+
LoadBalancingRule = $rule
194+
}
195+
$lb = New-AzLoadBalancer @lbp
196+
```
197+
198+
# [Azure CLI](#tab/azurecli/)
199+
200+
With Azure CLI, you:
201+
202+
- Create a cross-region load balancer with [`az network cross-region-lb create`](/cli/azure/network/az-network-cross-region-lb-rule-create).
203+
- Create a load balancer rule with [`az network cross-region-lb rule create`](/cli/azure/network/az-network-cross-region-lb-rule-create).
204+
205+
```azurecli
206+
207+
# Create cross-region load balancer
208+
az network cross-region-lb create --name myLoadBalancer-CR --resource-group myResourceGroupLB-CR --frontend-ip-name myFrontEnd-CR --backend-pool-name myBackEndPool-CR
209+
210+
# create a load balancer rule
211+
az network cross-region-lb rule create --backend-port 80 --frontend-port 80 --lb-name myLoadBalancer-CR --name myHTTPRule-CR --protocol tcp --resource-group myResourceGroupLB-CR --backend-pool-name myBackEndPool-CR --frontend-ip-name myFrontEnd-CR
212+
213+
```
214+
---
215+
216+
## Add load balancer frontends to cross-region load balancer
217+
218+
In this section, you add a frontend IP configuration to the cross-region load balancer.
219+
220+
# [Azure PowerShell](#tab/azurepowershell)
221+
222+
With Azure PowerShell, you:
223+
224+
- Use [`Set-AzLoadBalancerFrontendIpConfig`](/powershell/module/az.network/set-azloadbalancerfrontendipconfig) to add the regional load balancer frontend to the cross-region backend pool.
225+
- Use [`New-AzLoadBalancerBackendAddressConfig`](/powershell/module/az.network/new-azloadbalancerbackendaddressconfig) to create the backend address pool configuration for the load balancer.
226+
227+
```azurepowershell
228+
229+
## Create the cross-region backend address pool configuration for region 2 ##
230+
$RLB-BAF = @{
231+
Name = 'MyBackendPoolConfig-RLB'
232+
LoadBalancerFrontendIPConfigurationId = $RLBFE.Id
233+
}
234+
$beaddressconfigRLB = New-AzLoadBalancerBackendAddressConfig @region2ap
235+
236+
## Apply the backend address pool configuration for the cross-region load balancer ##
237+
$bepoolcr = @{
238+
ResourceGroupName = ‘ Resource Group B’
239+
LoadBalancerName = 'myLoadBalancer-CR'
240+
Name = 'myBackEndPool-CR'
241+
LoadBalancerBackendAddress = $beaddressconfigRLB
242+
}
243+
Set-AzLoadBalancerBackendAddressPool @bepoolcr
244+
245+
```
246+
247+
# [Azure CLI](#tab/azurecli/)
248+
249+
With Azure CLI, you add the frontends you placed in variables in the backend pool of the cross-region load balancer with use [`az network cross-region-lb address-pool`](/powershell/module/az.network/az-network-cross-region-lb-address-pool).
250+
251+
```azurecli
252+
253+
az network cross-region-lb address-pool address add \
254+
--frontend-ip-address ‘/subscriptions/Subscription A/resourceGroups/rg-name/providers/Microsoft.Network/loadBalancers/RLB-name /frontendIPConfigurations/RLB-LB Frontend Name’
255+
--lb-name myLoadBalancer-CR \
256+
--name myFrontEnd-R2 \
257+
--pool-name myBackEndPool-CR \
258+
--resource-group myResourceGroupLB-CR
259+
```
260+
261+
## Next steps
262+
263+
> [!div class="nextstepaction"]
264+
> [Create a cross-subscription internal load balancer](./cross-subscription-howto-internal-load-balancer.md)
265+
266+
267+
268+
269+
270+
271+
272+

includes/load-balancer-cross-subscription-prerequisites.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ ms.custom: include-file
1414

1515
# [Azure PowerShell](#tab/azurepowershell)
1616

17-
- Two Azure subscriptions. One subscription for the virtual network and another subscription for the load balancer.
17+
- Two Azure subscriptions.
1818
- An Azure account with active subscriptions. [Create an account for free](https://azure.microsoft.com/free/)
1919
- An existing [Virtual Network](../articles/virtual-network/quick-create-powershell.md). deployed in one of the subscriptions. For this example, the virtual network is in **Azure Subscription A**.
20+
- Azure PowerShell installed locally or Azure Cloud Shell.
2021

2122
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 5.4.1 or later. Run `Get-Module -ListAvailable Az` to find the installed version. If you need to upgrade, see Install Azure PowerShell module. If you're running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
2223

0 commit comments

Comments
 (0)