Tutorial: Configure routing preference for a VM using the Azure portal
This tutorial shows you how to configure routing preference for a virtual machine. Internet bound traffic from the VM will be routed via the ISP network when you choose Internet as your routing preference option. The default routing is via the Microsoft global network.
In this tutorial, you learn how to:
- Create a virtual machine with a public IP address configured for Internet routing preference.
- Verify the public IP address is set to Internet routing preference.
Prerequisites
- An Azure account with an active subscription. Create an account for free.
Create virtual machine
In this section, you'll create a virtual machine and public IP address. During the public IP address configuration, you'll select Internet for routing preference.
Sign in to the Azure portal.
In the portal search box, enter Virtual machine. In the search results, select Virtual machines.
In Virtual machines, select + Create, then + Virtual machine.
In the Basics tab of Create a virtual machine, enter, or select the following information.
Setting Value Project details Subscription Select your subscription. Resource group Select Create new.
Enter TutorVMRoutePref-rg. Select OK.Instance details Virtual machine name Enter myVM. Region Select (US) West US 2. Availability options Select No infrastructure redundancy required. Image Select Windows Server 2019 Datacenter - Gen2. Azure Spot instance Leave the default of unchecked. Size Select a size. Administrator account Username Enter a username. Password Enter a password. Confirm password Reenter password. Inbound port rules Public inbound ports Select Allow selected ports. Select inbound ports Leave the default of RDP (3389).
Opening port 3389 from the internet is not recommended for production workloads.Select Next: Disks then Next: Networking, or select the Networking tab.
In the networking tab, enter or select the following information.
Setting Value Network interface Virtual network Leave the default of (new) TutorVMRoutePref-rg-vnet. Subnet Leave the default of (new) default (10.1.0.0/24). Public IP Select Create new.
In Name, enter myPublicIP.
Select Standard in SKU.
In Routing preference, select Internet.
Select OK.Select Review + create.
Select Create.
Verify internet routing preference
In this section, you'll search for the public IP address previously created and verify the internet routing preference.
In the portal search box, enter Public IP address. In the search results, select Public IP addresses.
In Public IP addresses, select myPublicIP.
Select Properties in Settings.
Verify Internet is displayed in Routing preference.
Clean up resources
If you're not going to continue to use this application, delete the public IP address with the following steps:
In the search box at the top of the portal, enter Resource group.
In the search results, select Resource groups.
Select TutorVMRoutePref-rg
Select Delete resource group.
Enter myResourceGroup for TYPE THE RESOURCE GROUP NAME and select Delete.
Next steps
Advance to the next article to learn how to create a virtual machine with mixed routing preference: