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
Copy file name to clipboardExpand all lines: articles/virtual-network/ip-services/routing-preference-portal.md
+85-9Lines changed: 85 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,17 @@
1
1
---
2
-
title: Configure routing preference for a public IP address - Azure portal
3
-
description: Learn how to create a public IP with an Internet traffic routing preference
2
+
title: Configure routing preference for a public IP address
3
+
description: Learn how to create a public IP with an Internet traffic routing preference using the Azure portal, Azure PowerShell, or Azure CLI.
4
4
services: virtual-network
5
-
ms.date: 08/24/2023
5
+
ms.date: 07/25/2024
6
6
ms.author: mbender
7
7
author: mbender-ms
8
8
ms.service: virtual-network
9
9
ms.topic: how-to
10
10
---
11
11
12
-
# Configure routing preference for a public IP address using the Azure portal
12
+
# Configure routing preference for a public IP address
13
13
14
-
This article shows you how to configure [routing preference](routing-preference-overview.md) via ISP network (**Internet** option) for a public IP address. After creating the public IP address, you can associate it with the following Azure resources for inbound and outbound traffic to the internet:
14
+
This article shows you how to configure [routing preference](routing-preference-overview.md) via ISP network (**Internet** option) for a public IP address using the Azure portal, Azure PowerShell, or Azure CLI. After creating the public IP address, you can associate it with the following Azure resources for inbound and outbound traffic to the internet:
15
15
16
16
* Virtual machine
17
17
* Virtual machine scale set
@@ -22,9 +22,33 @@ This article shows you how to configure [routing preference](routing-preference-
22
22
23
23
By default, the routing preference for public IP address is set to the Microsoft global network for all Azure services and can be associated with any Azure service.
24
24
25
-
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) now.
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 6.9.0 or later. Run `Get-Module -ListAvailable Az` to find the installed version. If you need to upgrade, see [Install Azure PowerShell module](/powershell/azure/install-azure-powershell). If you are running PowerShell locally, you also need to run `Connect-AzAccount` to create a connection with Azure.
45
+
46
+
---
26
47
27
48
## Create a public IP address with a routing preference
49
+
50
+
# [Azure portal](#tab/azureportal)
51
+
28
52
1. Sign in to the [Azure portal](https://portal.azure.com/).
29
53
2. Select **Create a resource**.
30
54
3. In the search box, type *Public IP address*.
@@ -48,9 +72,61 @@ If you don't have an Azure subscription, create a [free account](https://azure.m
48
72
49
73
You can associate the above created public IP address with a [Windows](../../virtual-machines/windows/overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json) or [Linux](../../virtual-machines/linux/overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json) virtual machine. Use the CLI section on the tutorial page: [Associate a public IP address to a virtual machine](./associate-public-ip-address-vm.md) to associate the public IP to your VM. You can also associate the public IP address created above with an [Azure Load Balancer](../../load-balancer/load-balancer-overview.md), by assigning it to the load balancer **frontend** configuration. The public IP address serves as a load-balanced virtual IP address (VIP).
50
74
75
+
# [Azure CLI](#tab/azurecli/)
76
+
77
+
Create a resource group with the [az group create](/cli/azure/group#az-group-create) command. The following example creates a resource group in the **East US** Azure region:
78
+
79
+
```azurecli
80
+
az group create --name myResourceGroup --location eastus
81
+
```
82
+
## Create a public IP address
83
+
84
+
Create a Public IP Address with routing preference of **Internet** type using command [az network public-ip create](/cli/azure/network/public-ip#az-network-public-ip-create), with the format as shown below.
85
+
86
+
The following command creates a new public IP with **Internet** routing preference in the **East US** Azure region.
87
+
88
+
```azurecli
89
+
az network public-ip create \
90
+
--name MyRoutingPrefIP \
91
+
--resource-group MyResourceGroup \
92
+
--location eastus \
93
+
--ip-tags 'RoutingPreference=Internet' \
94
+
--sku STANDARD \
95
+
--allocation-method static \
96
+
--version IPv4
97
+
```
98
+
99
+
> [!NOTE]
100
+
> Currently, routing preference only supports IPV4 public IP addresses.
101
+
102
+
You can associate the above created public IP address with a [Windows](../../virtual-machines/windows/overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json) or [Linux](../../virtual-machines/linux/overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json) virtual machine. Use the CLI section on the tutorial page: [Associate a public IP address to a virtual machine](./associate-public-ip-address-vm.md) to associate the Public IP to your VM. You can also associate the public IP address created above with an [Azure Load Balancer](../../load-balancer/load-balancer-overview.md), by assigning it to the load balancer **frontend** configuration. The public IP address serves as a load-balanced virtual IP address (VIP).
103
+
104
+
# [Azure PowerShell](#tab/azurepowershell/)
105
+
106
+
The following command creates a new public IP with a routing preference type as *Internet* in the *East US* Azure region:
You can associate the above created public IP address with a [Windows](../../virtual-machines/windows/overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json) or [Linux](../../virtual-machines/linux/overview.md?toc=%2fazure%2fvirtual-network%2ftoc.json) virtual machine. Use the CLI section on the tutorial page: [Associate a public IP address to a virtual machine](./associate-public-ip-address-vm.md) to associate the Public IP to your VM. You can also associate the public IP address created above with an [Azure Load Balancer](../../load-balancer/load-balancer-overview.md), by assigning it to the load balancer **frontend** configuration. The public IP address serves as a load-balanced virtual IP address (VIP).
124
+
125
+
---
126
+
127
+
51
128
## Next steps
52
129
- Learn more about [public IP with routing preference](routing-preference-overview.md).
53
130
-[Configure routing preference for a VM](./tutorial-routing-preference-virtual-machine-portal.md).
54
-
-[Configure routing preference for a public IP address using the PowerShell](routing-preference-powershell.md).
55
-
- Learn more about [public IP addresses](public-ip-addresses.md#public-ip-addresses) in Azure.
56
-
- Learn more about all [public IP address settings](virtual-network-public-ip-address.md#create-a-public-ip-address).
131
+
-[Configure routing preference for a VM using the Azure CLI](./configure-routing-preference-virtual-machine-cli.md).
132
+
-[Configure routing preference for a VM using the Azure PowerShell](./configure-routing-preference-virtual-machine-powershell.md).
0 commit comments