|
| 1 | +--- |
| 2 | +title: Deploy a cross-region load balancer with Azure Resource Manager templates | Microsoft Docs |
| 3 | +description: Deploy a cross-region load balancer with Azure Resource Manager templates |
| 4 | +author: mbender-ms |
| 5 | +ms.author: mbender |
| 6 | +ms.service: load-balancer |
| 7 | +ms.topic: tutorial |
| 8 | +ms.date: 04/12/2023 |
| 9 | +ms.custom: template-tutorial |
| 10 | +#Customer intent: As a administrator, I want to deploy a cross-region load balancer for global high availability of my application or service. |
| 11 | +--- |
| 12 | + |
| 13 | +# Tutorial: Deploy a cross-region load balancer with Azure Resource Manager templates |
| 14 | + |
| 15 | +A cross-region load balancer ensures a service is available globally across multiple Azure regions. If one region fails, the traffic is routed to the next closest healthy regional load balancer. |
| 16 | + |
| 17 | +Using an ARM template takes fewer steps comparing to other deployment methods. |
| 18 | + |
| 19 | +[!INCLUDE [About Azure Resource Manager](../../includes/resource-manager-quickstart-introduction.md)] |
| 20 | + |
| 21 | +If your environment meets the prerequisites and you're familiar with using ARM templates, select the **Deploy to Azure** button. The template opens in the Azure portal. |
| 22 | + |
| 23 | +[](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure%2Fazure-quickstart-templates%2Fmaster%2Fquickstarts%2Fmicrosoft.network%2Fload-balancer-cross-region%2Fazuredeploy.json) |
| 24 | + |
| 25 | +In this tutorial, you learn how to: |
| 26 | + |
| 27 | +> [!div class="checklist"] |
| 28 | +> * All tutorials include a list summarizing the steps to completion |
| 29 | +> * Each of these bullet points align to a key H2 |
| 30 | +> * Use these green checkboxes in a tutorial |
| 31 | +
|
| 32 | +## Prerequisites |
| 33 | + |
| 34 | +- An Azure account with an active subscription. [Create an account for free] |
| 35 | + (https://azure.microsoft.com/free/?WT.mc_id=A261C142F) and access to the Azure portal. |
| 36 | + |
| 37 | +## Review the template |
| 38 | +In this section, you review the template and the parameters that are used to deploy the cross-region load balancer. |
| 39 | +The template used in this quickstart is from the [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/load-balancer-cross-region/). |
| 40 | + |
| 41 | +:::code language="json" source="~/quickstart-templates/quickstarts/microsoft.compute/2-vms-internal-load-balancer/azuredeploy.json"::: |
| 42 | + |
| 43 | +> [!NOTE] |
| 44 | +> When you create a standard load balancer, you must also create a new standard public IP address that is configured as the frontend for the standard load balancer. Also, the Load balancers and public IP SKUs must match. In our case, we will create two standard public IP addresses, one for the regional level load balancer and another for the cross-region load balancer. |
| 45 | +
|
| 46 | +Multiple Azure resources have been defined in the template: |
| 47 | +- [**Microsoft.Network/loadBalancers**](/azure/templates/microsoft.network/loadBalancers):Regional and cross-region load balancers. |
| 48 | + |
| 49 | +- [**Microsoft.Network/publicIPAddresses**](/azure/templates/microsoft.network/publicipaddresses): for the load balancer, bastion host, and for each of the virtual machines. |
| 50 | +- [**Microsoft.Network/bastionHosts**](/azure/templates/microsoft.network/bastionhosts) |
| 51 | +- [**Microsoft.Network/networkSecurityGroups**](/azure/templates/microsoft.network/networksecuritygroups) |
| 52 | + |
| 53 | +- [**Microsoft.Network/virtualNetworks**](/azure/templates/microsoft.network/virtualNetworks): Virtual network for load balancer and virtual machines. |
| 54 | + |
| 55 | +- [**Microsoft.Compute/virtualMachines**](/azure/templates/microsoft.compute/virtualMachines) (2): Virtual machines. |
| 56 | + |
| 57 | +- [**Microsoft.Network/networkInterfaces**](/azure/templates/microsoft.network/networkInterfaces) (2): Network interfaces for virtual machines. |
| 58 | + |
| 59 | +- [**Microsoft.Compute/virtualMachine/extensions**](/azure/templates/microsoft.compute/virtualmachines/extensions) (2): use to configure the Internet Information Server (IIS), and the web pages. |
| 60 | + |
| 61 | +To find more templates that are related to Azure Load Balancer, see [Azure Quickstart Templates](https://azure.microsoft.com/resources/templates/?resourceType=Microsoft.Network&pageNumber=1&sort=Popular). |
| 62 | + |
| 63 | +## Deploy the template |
| 64 | + |
| 65 | +1. Sign in to the Azure portal at [https://portal.azure.com](https://portal.azure.com). |
| 66 | +1. Enter and select **Deploy a custom template** in the search bar |
| 67 | +1. In the **Custom deployment** page, enter **load-balancer-cross-region** in the **Quickstart template** textbox and select **quickstarts/microsoft.network/load-balancer-cross-region**. |
| 68 | + |
| 69 | + :::image type="content" source="media/tutorial-deploy-cross-region-load-balancer-template/select-quickstart-template.png" alt-text="Screenshot of Custom deployment page for selecting quickstart ARM template."::: |
| 70 | + |
| 71 | +1. Choose **Select template** and enter the following information: |
| 72 | + |
| 73 | + | Name | Value | |
| 74 | + | --- | --- | |
| 75 | + | Subscription | Select your subscription | |
| 76 | + | Resource group | Select your resource group or create a new resource group | |
| 77 | + | Region | Select the deployment region for resources | |
| 78 | + | Project Name | Enter a project name used to create unique resource names | |
| 79 | + | LocationCR | Select the deployment region for the cross-region load balancer | |
| 80 | + | Location-r1 | Select the deployment region for the regional load balancer and VMs | |
| 81 | + | Location-r2 | Select the deployment region where the regional load balancer and VMs | |
| 82 | + | Admin Username | Enter a username for the virtual machines | |
| 83 | + | Admin Password | Enter a password for the virtual machines | |
| 84 | + |
| 85 | + |
| 86 | +1. Select **Review + create** to run template validation. |
| 87 | +1. If no errors are present, Review the terms of the template and select **Create**. |
| 88 | + |
| 89 | +## Verify the deployment |
| 90 | + |
| 91 | +1. If necessary, sign in to the [Azure portal](https://portal.azure.com). |
| 92 | +1. Select **Resource groups** from the left pane. |
| 93 | +1. Select the resource group used in the deployment. The default resource group name is the **project name** with **-rg** appended. For example, **crlb-learn-arm-rg**. |
| 94 | +1. Select the cross-region load balancer. Its default name is the project name with **-cr** appended. For example, **crlb-learn-arm-cr**. |
| 95 | +1. Copy only the IP address part of the public IP address, and then paste it into the address bar of your browser. The page resolves to a default IIS Windows Server web page. |
| 96 | + |
| 97 | + :::image type="content" source="media/tutorial-deploy-cross-region-load-balancer-template/default-web-page.png" alt-text="Screenshot of default IIS Windows Server web page in web browser."::: |
| 98 | + |
| 99 | +## Clean up resources |
| 100 | + |
| 101 | +When you no longer need them, delete the: |
| 102 | + |
| 103 | +* Resource group |
| 104 | +* Load balancer |
| 105 | +* Related resources |
| 106 | + |
| 107 | +1. Go to the Azure portal, select the resource group that contains the load balancer, and then select **Delete resource group**. |
| 108 | +1. Select **apply force delete for selected Virtual machines and Virtual machine scale sets**, enter the name of the resource group, and then select **Delete > Delete **. |
| 109 | + |
| 110 | +## Next steps |
| 111 | + |
| 112 | +In this tutorial, you: |
| 113 | +- Created a cross region load balancer\ |
| 114 | +- Created a regional load balancer |
| 115 | +- Created three virtual machines and linked them to the regional load balancer |
| 116 | +- Configured the cross-region load balancer to work with the regional load balancer |
| 117 | +- Tested the cross-region load balancer. |
| 118 | + |
| 119 | +Learn more about cross-region load balancer. |
| 120 | +Advance to the next article to learn how to create... |
| 121 | +> [!div class="nextstepaction"] |
| 122 | +> [Tutorial: Create a load balancer with more than one availability set in the backend pool](tutorial-multi-availability-sets-portal.md) |
0 commit comments