Skip to content

Commit 3ec1d47

Browse files
authored
Merge pull request #281841 from mbender-ms/ip-cc-us288990
content curation - merged PS/CLI into portal doc - routing-preference-portal.md
2 parents 53e782e + 88b509d commit 3ec1d47

File tree

5 files changed

+96
-152
lines changed

5 files changed

+96
-152
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4933,6 +4933,16 @@
49334933
"source_path_from_root": "/articles/virtual-network/ip-services/create-vm-dual-stack-ipv6-powershell.md",
49344934
"redirect_url": "/azure/virtual-network/ip-services/create-vm-dual-stack-ipv6-portal",
49354935
"redirect_document_id": false
4936+
},
4937+
{
4938+
"source_path_from_root": "/articles/virtual-network/ip-services/routing-preference-powershell.md",
4939+
"redirect_url": "/azure/virtual-network/ip-services/routing-preference-portal",
4940+
"redirect_document_id": false
4941+
},
4942+
{
4943+
"source_path_from_root": "/articles/virtual-network/ip-services/routing-preference-cli.md",
4944+
"redirect_url": "/azure/virtual-network/ip-services/routing-preference-portal",
4945+
"redirect_document_id": false
49364946
}
49374947

49384948
]

articles/virtual-network/ip-services/routing-preference-cli.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

articles/virtual-network/ip-services/routing-preference-portal.md

Lines changed: 85 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
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.
44
services: virtual-network
5-
ms.date: 08/24/2023
5+
ms.date: 07/25/2024
66
ms.author: mbender
77
author: mbender-ms
88
ms.service: virtual-network
99
ms.topic: how-to
1010
---
1111

12-
# Configure routing preference for a public IP address using the Azure portal
12+
# Configure routing preference for a public IP address
1313

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:
1515

1616
* Virtual machine
1717
* Virtual machine scale set
@@ -22,9 +22,33 @@ This article shows you how to configure [routing preference](routing-preference-
2222

2323
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.
2424

25-
If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) now.
25+
## Prerequisites
26+
27+
# [Azure portal](#tab/azureportal)
28+
29+
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
30+
31+
# [Azure CLI](#tab/azurecli/)
32+
33+
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
34+
35+
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](~/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
36+
37+
- This article requires version 2.0.49 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
38+
39+
# [Azure PowerShell](#tab/azurepowershell/)
40+
41+
[!INCLUDE [quickstarts-free-trial-note](~/reusable-content/ce-skilling/azure/includes/quickstarts-free-trial-note.md)]
42+
43+
[!INCLUDE [cloud-shell-try-it.md](~/reusable-content/ce-skilling/azure/includes/cloud-shell-try-it.md)]
44+
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+
---
2647

2748
## Create a public IP address with a routing preference
49+
50+
# [Azure portal](#tab/azureportal)
51+
2852
1. Sign in to the [Azure portal](https://portal.azure.com/).
2953
2. Select **Create a resource**.
3054
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
4872
4973
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).
5074

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:
107+
108+
```azurepowershell
109+
$iptagtype="RoutingPreference"
110+
$tagName = "Internet"
111+
$ipTag = New-AzPublicIpTag -IpTagType $iptagtype -Tag $tagName
112+
# attach the tag
113+
$publicIp = New-AzPublicIpAddress `
114+
-Name "MyPublicIP" `
115+
-ResourceGroupName $rg.ResourceGroupName `
116+
-Location $rg.Location `
117+
-IpTag $ipTag `
118+
-AllocationMethod Static `
119+
-Sku Standard `
120+
-IpAddressVersion IPv4
121+
```
122+
123+
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+
51128
## Next steps
52129
- Learn more about [public IP with routing preference](routing-preference-overview.md).
53130
- [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).

articles/virtual-network/ip-services/routing-preference-powershell.md

Lines changed: 0 additions & 72 deletions
This file was deleted.

articles/virtual-network/ip-services/toc.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,7 @@ items:
159159
- name: Routing preference
160160
items:
161161
- name: Create public IP address
162-
items:
163-
- name: Azure portal
164-
href: routing-preference-portal.md
165-
- name: Azure PowerShell
166-
href: routing-preference-powershell.md
167-
- name: Azure CLI
168-
href: routing-preference-cli.md
162+
href: routing-preference-portal.md
169163
- name: Move across regions
170164
items:
171165
- name: Public IPs

0 commit comments

Comments
 (0)